My problem, however, is I have coded it and it works flawlessly in Firefox. In checking in IE now, when the user submits an email address [to signup.php], it never gets into the loop.
Code: Select all
if(isset($_POST['submit']) && isset($_POST['email'])){...}It was supposed to go live yesterday, and so this is really irritating me when I thought I successfully completed the project and then some error that had never happened before pops up.
here's the full code for signup.php, with the sensitive stuff edited out.
Code: Select all
session_start();
echo("first");
if(isset($_POST['submit']) && isset($_POST['email'])){
echo("second");
$_SESSION['email'] = $_POST['email'];
$_SESSION['referer'] = $_POST['link'];
$referer = $_SESSION['referer'];
$email = $_SESSION['email'];
if(!check_email_address($email)){ //Bad email address, redirect back to original page
header("Location: redirect.php");
}
// Check to make sure the email does not match any current records in the DB.
//connect to the db
$con = mysql_connect($ip,$user,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($database,$con);
//query each row
$q="SELECT email, ksu_id FROM members";
$result = mysql_query($q) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
if($row['email'] == $email) {
include("define_top.php");
?>
Already exists message
<?
include("define_bot.php");
return;
}
}
//query unconfirmed email addresses
$q="SELECT * FROM unconfirmed";
$result = mysql_query($q) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
if($row['email'] == $email) {
//Send the new user an email
$m = new MAIL;
$m->From(...);
$m->AddTo($email);
$m->Subject('...');
$message = "..."
$m->HTML($message);
$m->Send();
include("define_top.php"); ?>
Needs to be confirmed message output
<? include("define_bot.php");
return;
}
}
//Insert the new email into the database
$salt = "...";
$hash = md5($email.$salt);
$q ="INSERT INTO unconfirmed (email,hash) VALUES('$email','$hash')";
mysql_query($q)or die(mysql_error());
mysql_close($con);
//Send the new user an email
$m = new MAIL;
$m->From('...);
$m->AddTo($email);
$m->Subject('...');
$message = "...";
$m->HTML($message);
$m->Send();
include("define_top.php"); ?>
Thank you message
<? include("define_bot.php");
}
echo("third");