Jump to content

Help with details script


Schlo_50

Recommended Posts

I need to send the delivery details of customers to my database. I have managed to create a register script for users to create a username and password which then gets stored into the database. I copied and pasted the same script and then adapted the variables to suit the new form's values and the database structure, however, i seem to be doing something wrong as i keep getting parse errors etc..

 

Can someone take a look at my now, more slightly modified script to see what is wrong?

 

<?php
$self=$_SERVER['PHP_SELF'];
$title=$_POST['title'];
$firstname=$_POST['fname'];
$surname=$_POST['sname'];
$addline1=$_POST['adline1'];
$addline2=$_POST['adline2'];
$city=$_POST['city'];
$postcode=$_POST['postcode'];
$contact=$_POST['hphone'];
$email=$_POST['email'];
?>
<?php
$conn = mysql_connect( "host","hostuname","password" )
														or die( "Err:Conn" );
$rs = mysql_select_db( "database", $conn ) 
			or die( "Err:Db" );	

if(isset($_POST[submit])){				
$sql= "INSERT INTO cust_tbl ( title,fname,sname,adline1,adline2,city,postcode,hphone,email )VALUES( \"$title\",\"$firstname\",\"$surname\",\"$addline1\",\"$addline2\",\"$city\",\"$postcode\",\"$contact",\"$email") )";} 
else {
Poo form
}

                             
$rs = mysql_query( $sql, $conn );
if ($rs){ echo( "Order Form Complete $firstname!" ); }

?>

 

Thanks in advance guys!

Link to comment
https://forums.phpfreaks.com/topic/41928-help-with-details-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.