Welcome Guest, Not a member yet? Register   Sign In
Need help posting drop down form into DB via $_POST

Hi !

I keep getting a PHP error message "Undefined Index: DeliveryID" coming off my model function createCustomer() featured below.

The form and the model function works great with all the other static form_input I have ( not included for clarity ) however I keep getting the above error message with the drop_down.

Form_dropdown :


echo form_open('admin/customer_reg/create');
echo "<p class='pickup' ><label for='DeliveryID'>Preferred Collection Point</label><br/>";
$DeliveryID = array('1'=>'Varsity',
   '2' => 'Westbrook',
   '3'=> 'Crowfoot',
   '4'=> 'Canmore',
echo form_dropdown('pickup', $DeliveryID,'Varsity')."</p>" ;

echo form_submit('submit','create account');
echo form_close();


function createCustomer(){
              $data = array( 'DeliveryID'  => db_clean($_POST['DeliveryID'],25),);
              $new_customer_id = $this->db->insert_id();

I have triple checked the DB to ensure things are spelt right and capitalised right. I have also tried changing 'DeliveryID' to $DeliveryID and that didn't help.

My theory is that I have got the syntax wrong when using a $_POST and the $DeliveryID array since essentially I am trying to put an array into an array then hope that the $this->db->insert() function pulls out the value correctly.

I have tried checking the forums adn wiki to no avail.

any ideas - this shoudl be a beginner level solution - I hope ! :o)


Theme © iAndrew 2016 - Forum software by © MyBB