Issues with IE and form handling
Posted: Fri Jun 13, 2008 10:26 am
Hi, I am creating a tool that registers a user for newsletter purposes. The general process is they submit their email address [any form], get sent a confirmation email with a link[from signup.php], click the link and are then required to fill out a form with general information[in register.php].
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.
never returns true. In testing, I have echo'd stuff before the conditional, inside, and after, and only the before and after appear. Does IE handle the $_POST superglobal any differently than FF?.
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.
And right now it's just outputting "firstthird" without my damned "second" in there. Thanks for the help!
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");