I posted this on general but maybe it belongs here under database..anyway, here I go.
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
$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: [email]webmaster@xxxx.com">) && 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: [email]webmaster@xxxx.com");
?>
<HTML>
<BODY>
Serial have been submitted to <?php echo $row[name] ?> at <?php echo $row[email] ?>.
</BODY>
</HTML>