Guest Posted March 8, 2010 Share Posted March 8, 2010 Hi all, I'm new to osCommerce and now asking for your big help as it's very critical to me!! I've seen some of the contributions to allow customers to upload products images which are cool and I'm using, too. Now I need to require (*) the user to upload their image (limited to MAX_FILE_SIZE) during registration to membership at PERSONAL DETAILS. What I've tried the below but it doesn't work: define ('ENTRY_PERSONAL_IMAGE_ERROR', 'Please upload photo'); customers_person_image is added to TABLE_CUSTOMERS (storing the name of the file) application_top.php got the line require(DIR_WS_CLASSES . 'upload.php'); upload.php is copied from catalog/admin/classes/upload.php DIR_FS_CATALOG_IMAGES is set to be images/pimage/ 1. tep_draw_file_field('person_image', 'file'); 2. check if is jpg, jpeg, JPG or JPEG; check if under MAX_FILE_SIZE; 3. if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) then 3.1 $person_image = tep_db_prepare_input($HTTP_POST_VARS['person_image']); 3.2 if $person_image == null then $messageStack->add('person_image', ENTRY_PERSONAL_IMAGE_ERROR); 4. If no error, $sql_data_array['customers_person_image'] = $person_image then tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); 5. $person_image = new upload('person_image'); I've done all the above but after press submit, the screen got no response and standstill. No entries are added and nothing happen until I reloaded it!! Can anyone got a big helping hand to guide me?? BTW, is $person_image storing the full path of the file of only just the filename? MANY THANKS!! Calvin Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2010 Share Posted March 8, 2010 Here is the additional field I've added at the bottom-most of the page BTW, I don't know how to set the field to be a (*) required field. Please help! Link to comment Share on other sites More sharing options...
Guest Posted March 10, 2010 Share Posted March 10, 2010 Could anybody help please? Many thanks! Link to comment Share on other sites More sharing options...
Guest Posted March 12, 2010 Share Posted March 12, 2010 Anybody and help or comment? Pls..... Link to comment Share on other sites More sharing options...
diy Posted March 12, 2010 Share Posted March 12, 2010 I think that the required or not part is set in the database through phpmyadmin putting a no in the value NULL makes it required and yes not required . The asterisk i think is set in the catalog/includes/languges/ english.php ex the asterisk in last name <tr> <td class="main"><?php echo ENTRY_LAST_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('lastname') . ' ' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td> </tr> is set in catalog/includes/languges/ english.php define('ENTRY_LAST_NAME_TEXT', '*'); see also http://www.oscommerce.com/forums/topic/79686-making-required-fields-not-required/ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.