Re: passing form information.
| From: | Payne | Date: | Thu, 02 Oct 2003 18:32:50 +0000 |
| Subject: | Re: passing form information. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164802@lists.php.net to get a copy of this message | ||
I tried that and I am still get this.....
INSERT INTO leads (leads_id, title, f_name, l_name) VALUES ( '', '', '', '');
and empty information is being posted into the database.
Chuck
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 <-- snip --> From: "Payne" <payne@magidesign.com>I am working a form to pass information from it to mysql data. I am able to connect to the database. But nothing is being pass from the form to the php page. This is my php code... ---------------------form.html----------------------------------------------------<html> <head> <title>Untitled</title> </style> </head> <body> <form name="form1" method="post" action="addlead.php"> <input name="title" type="text" size="40"> <input name="f_name" type="text" size="40"> <input name="l_name" type="text" size="40"> <input type="submit" name="Submit" value="Submit Information"> </form> </body> </html> --------------------------addleads.php------------------------------------------<? include("./config.php"); $sql = "INSERT INTO $table_name---------(leads_id, title, f_name, l_name) VALUES ('$leads_id', \"$title\", \"$f_name\", \"$l_name\")";//debug tool print $sql; $result = mysql_query($sql, $connection) or die ("Couldn't execute query."); ?> <html> <head> <title>Untitled</title> </style> </head> <body> <? echo $title ?> <br> <? echo $f_name ?> <br> <? echo $l_name> --------------------------------------------------------------------------What I am getting this.... INSERT INTO leads (leads_id, title, f_name, l_name) VALUES ('', "", "","")*Salutation* *First Name* *Last Name*<-- snip -->