I have a database on my server and a php page on my site referring to that database....the fields it calls to are name,email,refno. Simply put, the user enters his name,email and reference number and when he submits the info it will email him/her a unique serial number. I have included the php page on this post.
this is my problem the is. I am having trouble creating a user interface page that will link this info to the fields on this page.
any help would be appreciated.
<?php
// Check if we have all the nessasary information
if(!(isset($GET[name]) && isset($GET[email]) && isset($_GET[refno])))
exit;
$row = "";
$link = mysql_connect("db.xxxx.com", "xxxx" ,"xxxx");
mysql_select_db("database");
$query = "SELECT * FROM email_serials WHERE refno='$_GET[refno]'";
$result = mysql_query($query);
if(mysql_num_rows($result))
$row = mysql_fetch_array($result);
else {
$query = "UPDATE `email_serials` SET refno='$_GET[refno]', name='$_GET[name]', email='$_GET[email]' WHERE ISNULL(refno) LIMIT 1";
mysql_query($query);
$result = mysql_query("SELECT * FROM `email_serials` WHERE refno='$_GET[refno]'");
$row = mysql_fetch_array($result);
}
$subject = "Your serial";
$message = "Dear $row[name],
Your serial is: $row[serial]
Your registration code is: $_GET[refno]
Please keep this information for future reference.
";
mail("$row[name] <$row[email]>", $subject, $message, "From: webmaster@xxxx.com");
?>
<HTML>
<BODY>
Serial have been submitted to <?php echo $row[name] ?> at <?php echo $row[email] ?>.
</BODY>
</HTML>