Well I got as far as creating the form but now I can't seem to get it to do anything. I've been looking at this code too long and I'm hoping someone will spot my error. The code I'm including is from signup_form.php. This php file is called by an include from index.php.
if(isset($submit_add)){
$get_specs = db_query("
SELECT *
FROM user_specs
WHERE ID = 1");
$spec = db_fetch_array($get_specs);
unset($error);
if(!ereg($spec['EmailSpec'], $_GET['Email'])){
$error = 1;
$email_error = 1;
}
if(!isset($error)){
$insert = db_query("
insert into $insert_table(
ID,
Email
) values (
'',
'$Email'
)
");
$html .= "\r\n\t<tr><td>Welcome! We hope you find this site useful."</td></tr>;
echo $html;
}
}
if(!isset($submit_add) OR isset($error)){
if(!isset($Email)){
$Email = "";
}
$html = "\r\n\t<form method=\"post\" action=\"index.php?&s=$s&show=home&tree=home&pg=sgnup\">";
$html .= "\r\n\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"MainText\">";
$html .= "\r\n\t<tr><td width=\"25%\" height=\"33\"> </td>";
$html .= "<td height=\"20\" width=\"75%\">";
$html .= "<font size=\"1\" class=\"ErrorText\">* indicates a required field</font></td></tr>";
$html .= "\r\n\t<tr><td align=\"right\"><font class=\"ErrorText\">*</font> Email</td>";
$html .= "\r\n\t<td><input type=\"text\" name=\"Email\" maxlength=\"100\" ";
$html .= "size=\"35\" value=\"" . $Email . "\">";
if(isset($email_error)){
$html .= "<br /><font class=\"ErrorText\">Email must be in the form 'user@domain.com'</font>";
}
$html .= "</td></tr>";
$html .= "<tr><td> </td>";
$html .= "<td><input type=\"submit\" name=\"submit_add\" value=\"Submit\"></td></tr>";
$html .= "</table>";
$html .= "</form>";
}
echo $html;
I do not get any errors. From what I can tell it just keeps running the "if(!isset($submit_add) OR isset($error)){" section of code and the var $submit_add is never getting populated. Help!?!?! 🙁