06-02-2005, 12:37 AM
|
#6 (permalink)
|
|
The Acquainted
Join Date: May 2005
Posts: 106
Thanks: 0
|
ooops ws a syntax, try again
also i was newbie once too. so, don't worry, maybe you'll get it in less time thatn me :)
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 mysql_error();
}
mysql_close($con);
}
else
{
echo 'Could not connect to database<br>';
}
?>
__________________
---------------------------
Errors = Improved Programming.
Portfolio
|
|
|