Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Help on uploading image in personal details during membership registration


Recommended Posts

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/



tep_draw_file_field('person_image', 'file');

2. check if is jpg, jpeg, JPG or JPEG; check if under MAX_FILE_SIZE;


if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) 



$person_image = tep_db_prepare_input($HTTP_POST_VARS['person_image']);


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);


$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?





Link to comment
Share on other sites

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

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


               <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>

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


This topic is now archived and is closed to further replies.

  • Create New...