06-02-2005, 12:01 AM
|
#2 (permalink)
|
|
The Acquainted
Join Date: May 2005
Posts: 106
Thanks: 0
|
Hi,
not sure exactly. i have changed the code(just to correct something which you should think about (not necessary, bu tgood to have)
try this code and see if error is again there
PHP Code:
<?php
$FirstName = mysql_escape_string($_GET["FirstName"]);//use this function on all the input before storing it in database
$LastName = $_GET["LastName"];
$Email = $_GET["Email"];
$Phone = $_GET["Phone"];
$Address = $_GET["Address"];
$City = $_GET["City"];
$State = $_GET["State"];
$Zip = $_GET["Zip"];
$Username = $_GET["Username"];
$Password = $_GET["Password"];
$LastLogin = date("Y-m-d");
print "FirstName is $FirstName<br>\n";
print "Email is $Email<br>\n";
$con = @mysql_connect("localhost", "dbname", "dbpassword");
if($con)
{
$query = "insert into dbname.dbtable (FirstName, LastName, Email, Phone, Address, City, State, Zip, Username, Password, LastLogin)".
"values('$FirstName', '$LastName', '$Email', '$Phone', '$Address', '$City', '$State', '$Zip', '$Username', '$Password', '$LastLogin')"
$result = mysql_query($query);
if ($result)
{
echo <<<EOT
Thank You
Your signup is appreciated.
EOT;
}
else
{
echo "Something went awry with the awful SQL";
}
mysql_close($con);
}
else
{
echo 'Could not connect to database<br>';
}
?>
__________________
---------------------------
Errors = Improved Programming.
Portfolio
|
|
|