PLavelle
asked on
Firefox 1.xx bug on Macs
When users try to sign up for an account using Firefox version 1.xx on a Mac, the get prompted to download a file (the next page) after hitting submit. Since I don't have a Mac, this is becoming very difficult to debug.
Here is the page:
http://ww.petelavelle.com/adMan/signUp.php
The code for the page is located here:
http://www.petelavelle.com/download/Signup.zip
Can someone help me figure out what is going wrong?
Here is the page:
http://ww.petelavelle.com/adMan/signUp.php
The code for the page is located here:
http://www.petelavelle.com/download/Signup.zip
Can someone help me figure out what is going wrong?
ASKER
<?php
require("globals.php");
$formBean = new FormBean();
$formBean->addField(new TextField("company", "Company Name", REQUIRED, 40, 1, 20));
$formBean->addField(new PersonNameField("name", "Contact's Name", REQUIRED));
$formBean->addField(new EmailAddrField("email", "Contact's Email", REQUIRED));
$formBean->addField(new UsernameField("user", "Username", REQUIRED));
$formBean->addField(new PickPasswordField("passwor d", "Password", REQUIRED));
$formBean->addField(new PickPasswordField("passwor d2", "Retype Password", REQUIRED));
$formBean->addField(new PasswordQuestionField("pas sword_ques tion", "Password Question", REQUIRED, "[Select One]"));
$formBean->addField(new PasswordAnswerField("passw ord_answer ", "Password Answer", REQUIRED));
$formBean->addField(new CountryField("country", "Country", REQUIRED, "[Select One]"));
$formBean->addField(new StateField("state", "State (If in USA)", NOT_REQUIRED, " "));
$formBean->addField(new TextField("referrer", "How Did You Hear About Us?", NOT_REQUIRED, 40, 1, 30));
$formBean->addField(new CheckboxField("nationwide_ advertiser ", "" .
"Check here if you would like to be <br/>" .
"listed on our <a href='../nationwideListing s.php' target='_blank'>‘Nationwid e Listings’</a> page."));
$formBean->addField(new SubmitField("_submit", "Submit"));
$formBean->addField(new SubmitField("cancel", "Cancel"));
$formBean->getParameters() ;
if ($formBean->getValue("_sub mit")) {
if (strcmp($formBean->getValu e("country "), "United States") == 0)
$formBean->formFields["sta te"]->chec kForBlank( );
if (!($formBean->getValue("pa ssword") === $formBean->getValue("passw ord2"))) {
$formBean->setError("passw ord2", "does not match Password!");
}
if ($formBean->checkValues()) {
$sql =
"INSERT INTO " . AD_MAN_TABLE_PREFIX . "users "
. "(username,name,password,p assword_qu estion,"
. "password_answer,email,ins erted_on) "
."VALUES "
. "(" . $formBean->getDbValue("use r") . ","
. $formBean->getDbValue("nam e") . ","
. "MD5(" . $formBean->getDbValue("pas sword") . "),"
. $formBean->getDbValue("pas sword_ques tion") . ","
. $formBean->getDbValue("pas sword_answ er") . ","
. $formBean->getDbValue("ema il") . ",NOW())";
if (!gmysql_query($sql, true)) {
$formBean->setError("user" , "already exists");
} else {
$userId = getSimpleValue("SELECT user_id FROM " . AD_MAN_TABLE_PREFIX . "users WHERE username=" . $formBean->getDbValue("use r"));
gmysql_query(
"INSERT INTO " . AD_MAN_TABLE_PREFIX . "advertisers "
. "(user_id,company,referrer ,country,s tate,natio nwide_adve rtiser) VALUES "
. "('" . $userId . "', "
. $formBean->getDbValue("com pany") . ", "
. $formBean->getDbValue("ref errer") . ", "
. $formBean->getDbValue("cou ntry") . ", "
. $formBean->getDbValue("sta te") . ", "
. $formBean->getDbValue("nat ionwide_ad vertiser")
. ")"
);
$groupId = getSimpleValue("SELECT group_id FROM " . AD_MAN_TABLE_PREFIX . "groups WHERE name='Advertiser'");
gmysql_query("INSERT INTO " . AD_MAN_TABLE_PREFIX . "group_members (group_id,user_id) VALUES ('" . $groupId . "','" . $userId . "')", true);
// Create default campaign
gmysql_query("INSERT INTO " . AD_MAN_TABLE_PREFIX . "campaigns (user_id,campaign_name,ins erted_on) VALUES ('" . $userId . "','Campaign #1',NOW())");
login($userId, $formBean->getValue("user" ));
$message = wordwrap(
"Dear " . $formBean->getValue("name" ) . ",\n\n"
. "Thank you for signing up for an AdMan advertiser account on " . $GLOBALS["PREFS"]["company _url"] . ".\n\n"
. "Here is your new account info:\n"
. "Username: " . $formBean->getValue("user" ) . "\n"
. "Password: (Not displayed for security reasons).\n\n"
. "You can login at " . $GLOBALS["AD_MAN_ROOT_URL" ] . "\n\n"
. __SIGNATURE,
__WRAP_EMAIL_LENGTH
);
mail($formBean->getValue(" email"), "New Advertiser Account", $message, "From: " . __CONTACT_EMAIL);
if($formBean->getValue("na tionwide_a dvertiser" )){
$message = wordwrap(
"A new nationwide advertiser has signed up for an account." . ",\n\n"
. "Contact name: " . $formBean->getValue("name" ) . ".\n"
. "Contact email: " . $formBean->getValue("email ") . ".\n"
. "Company: " . $formBean->getValue("compa ny") . ".\n"
. "State: " . $formBean->getValue("state ") . ".\n"
. "Country: " . $formBean->getValue("count ry") . ".\n\n"
. __SIGNATURE,
__WRAP_EMAIL_LENGTH
);
mail(__CONTACT_EMAIL, "New Nationwide Advertiser", $message, "From: " . __CONTACT_EMAIL);
}
if ($_REQUEST["goTo"]) {
$goToUrl = $_REQUEST["goTo"];
} else {
$goToUrl = "advertiser/listCampaigns. php";
}
header("Location: confirmation.php?msg=" . rawurlencode("Advertiser Account Created") . "&goTo=" . urlencode($goToUrl));
exit();
}
}
}
if ($formBean->getValue("canc el")) {
header("Location: index.php");
exit();
}
?>
<html>
<head>
<title>Advertiser Sign Up</title>
<? require("section1.php"); ?>
</head>
<body onLoad="setFocus();">
<? require("section2.php"); ?>
<h1 class="FORMfields">
Advertiser Sign Up
</h1>
<table class="tableHelpers">
<tr class="tableHelpersFormFie lds">
<td class="tableHelpersFormFie lds1" style="width:600px">
<STRONG><B><FONT face=Verdana color=red><SPAN
style="COLOR: red; FONT-FAMILY: Verdana">NOTE TO MAC
USERS:</SPAN></FONT></B></ STRONG>
<DIV>
<P><FONT face=Verdana><SPAN
style="FONT-FAMILY: Verdana">We are currently experiencing
some problems with accounts setup by users on Mac computers. If you are
signing up for an account on a Mac, please do not use the Safari browser. Your
account will not be activated. You may use the Firefox browser, but
please note: once you create your account, you will be prompted to
download a confirmation page. Once downloaded, it will look like nothing has
happened. Please then return to the main login page and login with the
username and password you just created. Your account should be
active.</SPAN></FONT></P>< /DIV>
</td>
</tr>
</table>
<form action="" method="post">
<?= $formBean->getTableTag() ?>
</form>
<? require("section3.php"); ?>
</body>
</html>
require("globals.php");
$formBean = new FormBean();
$formBean->addField(new TextField("company", "Company Name", REQUIRED, 40, 1, 20));
$formBean->addField(new PersonNameField("name", "Contact's Name", REQUIRED));
$formBean->addField(new EmailAddrField("email", "Contact's Email", REQUIRED));
$formBean->addField(new UsernameField("user", "Username", REQUIRED));
$formBean->addField(new PickPasswordField("passwor
$formBean->addField(new PickPasswordField("passwor
$formBean->addField(new PasswordQuestionField("pas
$formBean->addField(new PasswordAnswerField("passw
$formBean->addField(new CountryField("country", "Country", REQUIRED, "[Select One]"));
$formBean->addField(new StateField("state", "State (If in USA)", NOT_REQUIRED, " "));
$formBean->addField(new TextField("referrer", "How Did You Hear About Us?", NOT_REQUIRED, 40, 1, 30));
$formBean->addField(new CheckboxField("nationwide_
"Check here if you would like to be <br/>" .
"listed on our <a href='../nationwideListing
$formBean->addField(new SubmitField("_submit", "Submit"));
$formBean->addField(new SubmitField("cancel", "Cancel"));
$formBean->getParameters()
if ($formBean->getValue("_sub
if (strcmp($formBean->getValu
$formBean->formFields["sta
if (!($formBean->getValue("pa
$formBean->setError("passw
}
if ($formBean->checkValues())
$sql =
"INSERT INTO " . AD_MAN_TABLE_PREFIX . "users "
. "(username,name,password,p
. "password_answer,email,ins
."VALUES "
. "(" . $formBean->getDbValue("use
. $formBean->getDbValue("nam
. "MD5(" . $formBean->getDbValue("pas
. $formBean->getDbValue("pas
. $formBean->getDbValue("pas
. $formBean->getDbValue("ema
if (!gmysql_query($sql, true)) {
$formBean->setError("user"
} else {
$userId = getSimpleValue("SELECT user_id FROM " . AD_MAN_TABLE_PREFIX . "users WHERE username=" . $formBean->getDbValue("use
gmysql_query(
"INSERT INTO " . AD_MAN_TABLE_PREFIX . "advertisers "
. "(user_id,company,referrer
. "('" . $userId . "', "
. $formBean->getDbValue("com
. $formBean->getDbValue("ref
. $formBean->getDbValue("cou
. $formBean->getDbValue("sta
. $formBean->getDbValue("nat
. ")"
);
$groupId = getSimpleValue("SELECT group_id FROM " . AD_MAN_TABLE_PREFIX . "groups WHERE name='Advertiser'");
gmysql_query("INSERT INTO " . AD_MAN_TABLE_PREFIX . "group_members (group_id,user_id) VALUES ('" . $groupId . "','" . $userId . "')", true);
// Create default campaign
gmysql_query("INSERT INTO " . AD_MAN_TABLE_PREFIX . "campaigns (user_id,campaign_name,ins
login($userId, $formBean->getValue("user"
$message = wordwrap(
"Dear " . $formBean->getValue("name"
. "Thank you for signing up for an AdMan advertiser account on " . $GLOBALS["PREFS"]["company
. "Here is your new account info:\n"
. "Username: " . $formBean->getValue("user"
. "Password: (Not displayed for security reasons).\n\n"
. "You can login at " . $GLOBALS["AD_MAN_ROOT_URL"
. __SIGNATURE,
__WRAP_EMAIL_LENGTH
);
mail($formBean->getValue("
if($formBean->getValue("na
$message = wordwrap(
"A new nationwide advertiser has signed up for an account." . ",\n\n"
. "Contact name: " . $formBean->getValue("name"
. "Contact email: " . $formBean->getValue("email
. "Company: " . $formBean->getValue("compa
. "State: " . $formBean->getValue("state
. "Country: " . $formBean->getValue("count
. __SIGNATURE,
__WRAP_EMAIL_LENGTH
);
mail(__CONTACT_EMAIL, "New Nationwide Advertiser", $message, "From: " . __CONTACT_EMAIL);
}
if ($_REQUEST["goTo"]) {
$goToUrl = $_REQUEST["goTo"];
} else {
$goToUrl = "advertiser/listCampaigns.
}
header("Location: confirmation.php?msg=" . rawurlencode("Advertiser Account Created") . "&goTo=" . urlencode($goToUrl));
exit();
}
}
}
if ($formBean->getValue("canc
header("Location: index.php");
exit();
}
?>
<html>
<head>
<title>Advertiser Sign Up</title>
<? require("section1.php"); ?>
</head>
<body onLoad="setFocus();">
<? require("section2.php"); ?>
<h1 class="FORMfields">
Advertiser Sign Up
</h1>
<table class="tableHelpers">
<tr class="tableHelpersFormFie
<td class="tableHelpersFormFie
<STRONG><B><FONT face=Verdana color=red><SPAN
style="COLOR: red; FONT-FAMILY: Verdana">NOTE TO MAC
USERS:</SPAN></FONT></B></
<DIV>
<P><FONT face=Verdana><SPAN
style="FONT-FAMILY: Verdana">We are currently experiencing
some problems with accounts setup by users on Mac computers. If you are
signing up for an account on a Mac, please do not use the Safari browser. Your
account will not be activated. You may use the Firefox browser, but
please note: once you create your account, you will be prompted to
download a confirmation page. Once downloaded, it will look like nothing has
happened. Please then return to the main login page and login with the
username and password you just created. Your account should be
active.</SPAN></FONT></P><
</td>
</tr>
</table>
<form action="" method="post">
<?= $formBean->getTableTag() ?>
</form>
<? require("section3.php"); ?>
</body>
</html>
ASKER
I think this line is causing the download prompt:
header("Location: confirmation.php?msg=" . rawurlencode("Advertiser Account Created") . "&goTo=" . urlencode($goToUrl));
header("Location: confirmation.php?msg=" . rawurlencode("Advertiser Account Created") . "&goTo=" . urlencode($goToUrl));
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry about that. The null error is fixed.
Thanks for testing it for me.
Could a couple more people do a test for me? I am stuck without a Mac for the time being.
Thanks for testing it for me.
Could a couple more people do a test for me? I am stuck without a Mac for the time being.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Would you mind trying to sign up on the live site?
http://www.weddingwarehouse.com/adMan/signUp.php
I appreciate your time. This one is very tough for me to debug because I don't have a Mac.
http://www.weddingwarehouse.com/adMan/signUp.php
I appreciate your time. This one is very tough for me to debug because I don't have a Mac.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much!
ASKER
http://ww.petelavelle.com/adMan/signUp.php