Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Job Title field in account


DuFF1

Recommended Posts

I added a dropdown field where the customer can choose his Job Title... Presently, the field number is stored instead of the field name. How can I store the field name instead the field number?

 

 

<...>

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

<...>

$sql_data_array = array('customers_firstname' => $firstname,

'customers_lastname' => $lastname,

'customers_job_title' => $job_title,

'customers_email_address' => $email_address,

'customers_telephone' => $telephone,

'customers_fax' => $fax,

'customers_newsletter' => $newsletter,

'customers_password' => tep_encrypt_password($password),

'customers_status' => $cust_status);

<...>

<tr>

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

<td class="main"><?php

$job_title_array = array();

$job_title_query = tep_db_query("select job_title_id, job_title_name from " . JOB_TITLE . " order by job_title_name");

while ($job_title_values = tep_db_fetch_array($job_title_query)) {

$job_title_array[] = array('id' => $job_title_values['job_title_id'], 'text' => $job_title_values['job_title_name']);

}

if (count($job_title_array) > 0) {

echo tep_draw_pull_down_menu('job_title', $job_title_array);

} else {

echo tep_draw_input_field('job_title');

}

if (tep_not_null(ENTRY_JOB_TITLE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_JOB_TITLE_TEXT;

?></td>

</tr>

<...>

Edited by DuFF1
Link to comment
Share on other sites

Replace

$job_title_array[] = array('id' => $job_title_values['job_title_id'], 'text' => $job_title_values['job_title_name']);

 

With:

$job_title_array[] = array('id' => $job_title_values['job_title_name'], 'text' => $job_title_values['job_title_name']);

Open source n'est pas un échange à sens unique ... La plupart du temps un simple merci ou quelques mots d'encouragement suffisent...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...