I have the following form <head> <title>Mapleside Farms</title> <link rel="stylesheet" href="mapleside.css" type="text/css" /></head><form name = "account" action="account.php" method = "post"> Enter information<input type=text name="lastname"><br><input type=text name="firstname"><br><input type=text name="address"><br><input type=text name="city"><br><input type=text name="state"><br><input type=text name="zipcode"><br><input type=text name="email"><br><input type=text name="username"><br><input type=text name="password"><br></form>
And the following php page<?php$Customer_Lname=$_POST['lastname'];$Customer_Fname=$_POST['firstname'];$Customer_address=$_POST['address'];$Customer_city=$_POST['city'];$Customer_state=$_POST['state'];$Customer_zipcode=$_POST['zipcode'];$Customer_email=$_POST['email'];$Customer_username=$_POST['username'];$Customer_password=$_POST['password'];// open connection to database$db = mysql_connect("localhost", "root", "");if (!$db){ print "unable to connect!"; exit;}//select database to use$db= mysql_select_db ("mapleside");if (!$db){ print "could not select database"; exit;}// create SQL query string$query = "INSERT INTO customer (Customer_Lname, Customer_Fname, Customer_address, Customer_city, Customer_state, Customer_zipcode, Customer_email, Customer_username, Customer_password) VALUES ($Customer_Lname, $Customer_Fname, $Customer_address, $Customer_city, $Customer_state, $Customer_zipcode, $Customer_email, $Customer_username , $Customer_password)";$result = mysql_query($query);mysql_query($query) or die ('Error, insert query failed');echo('Data inserted successfully' );//close connectionmysql_close();?>However, when I run my form and php pages, I get undefined variable errors. Can anyone lead me in the right direction????