Welcome Guest, Not a member yet? Register   Sign In
referencing a $_POST in the controller
#1

[eluser]dgriffter[/eluser]
Hi,

I?m getting an error of undefined index when I try to select from my database using a $_POST variable.

The code in the controller is:

function search(){
$reference = $this->session->userdata($_POST['reference']);
$data['session_id']=$reference ;
$data['query4']= $this->db->query('SELECT * FROM product WHERE idreference="'.$reference.'"');
$this->load->view('search', $data);
}

My code in the form in the view file is:

<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<input type="text" name="reference" value="">
<input type="submit" name="Search" value="Search" />
</form>


Can someone please tell me where I'm going wrong, it's been driving me wild for ages...

Many thanks in advance...

Dgriffter


Messages In This Thread
referencing a $_POST in the controller - by El Forum - 11-26-2007, 04:07 PM
referencing a $_POST in the controller - by El Forum - 11-26-2007, 04:12 PM
referencing a $_POST in the controller - by El Forum - 11-26-2007, 06:29 PM
referencing a $_POST in the controller - by El Forum - 11-26-2007, 08:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB