Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Input Check


gianpiero

Recommended Posts

Hi! I've modified create_account.php, adding the new field VAT:

 

if ( ACCOUNT_COMPANY == 'true' ) {

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

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

}

 

....

 

 

if ( !empty( $company ) ) {

if ( strlen( $vat ) != 11 ) {

$error = true;

 

$messageStack->add('create_account', ENTRY_VAT_ERROR);

}

}

 

....

 

if ($error == false) {

$sql_data_array = array('vat' => $vat,

'customers_firstname' => $firstname,

'customers_lastname' => $lastname,

'customers_email_address' => $email_address,

'customers_telephone' => $telephone,

'customers_fax' => $fax,

'customers_newsletter' => $newsletter,

'customers_password' => tep_encrypt_password($password));

 

if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;

if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);

 

tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

 

....

 

<tr>

<td class="main"><?php echo ENTRY_COMPANY; ?></td>

<td class="main"><?php echo tep_draw_input_field('company') . ' ' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>

</tr>

 

<tr>

<td class="main"><?php echo ENTRY_VAT; ?></td>

<td class="main"><?php echo tep_draw_input_field('vat') . ' ' . (tep_not_null(ENTRY_VAT_TEXT) ? '<span class="inputRequirement">' . ENTRY_VAT_TEXT . '</span>': ''); ?></td>

</tr>

 

....

 

I've added in ADDRESS_BOOK Table entry_vat

 

Why if I insert in the VAT field (and the COMPANY FIELD) a string as "hello", I don't receive any error message?Instead, the "hello" string is present in my database....why?

 

Please help me!

 

Bye bye

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...