Re: passing form information.

From: Date: Thu, 02 Oct 2003 18:37:57 +0000
Subject: Re: passing form information.
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-164804@lists.php.net to get a copy of this message
If I use the $l_name = $_POST["l_name"]; am I correct to believe that that will go in php area before the sql statement? Chris Sherwood wrote:
Dont apologize. even the best of us make mistakes. the .$field. is a more reliable way of displaying the information contained within. as in a few cases I find the variable itself gets printed ie $field shows up as $field in cases where I didnt use the .$field. just an observation on my part. if the form name was a typo then you will want to check your register_globals in your php.ini file it probably is turned off in which case you want to use $l_name = $_POST["l_name"]; etc.. this will give you the var values with out having to change your php.ini its also more secure if what I read is correct. Chris
I am LD. I do have the <? echo ?> in my code. The leads_id is an autonumber, it the primary key for the table. What do the .$field. gives you over $field? Also another LD mistake, addlead.php is addlead.php. I will try it. Payne Chris Sherwood wrote:
Hi Payne for starters your missing an ? at the last echo <? echo $l_name> secondly I would rewrite the sql statement to read $sql = "INSERT INTO $table_name
       (leads_id, title, f_name, l_name)
       VALUES
       (' ".$leads_id." ', ' ".$title." ', ' ".$f_name." ', '
     
".$l_name."
');"; but the statement itself shouldnt cause a problem either way. I am wondering where leads_id comes from however.. is it an auto number? and finally your processing form is called addlead.php and the form is posting to a form called addleads.php hope this helps chris
     


« previous php.general (#164804) next »