Ohio Guy Posted October 7, 2009 Share Posted October 7, 2009 I have a php script that opens new pages when you select next page which in the first page says sign up now. However, in firefox, it will not open a new page. It will open the same page even if the script has the new page. However, if I right click and select open in new page, it will open the page. This is the first part of the script. <? //get _GET $step = $page; ///////////////////////////////////////////////////////// // Sign Up Ad, gives details about signing up etc... ///////////////////////////////////////////////////////// if ($step=="signup1") { $cost = $cfg ["monthly_cost"]; echo "<div align=center><h1>Sign up here<BR><font size=2><B>Local Business Section.</font></h1><B><font size=4> Get a membership which allows you to post an unlimited number of coupons for one year.<p> <table width=65%><div align=left> You have complete control over your coupons and advertising.<UL> <LI>No more misprinted coupons with the wrong phone number, wrong product, or wrong price. <LI>Make your changes instantly. <LI>Make your special offer available immediately. <LI>When coupons expire, they are removed automatically. <LI>Have your own page with your coupons on it.</div></table> <P>"; echo "<a href='http://www.couponfile.net/couponscript5/couponsite/index.php?page=signup2'><font size=5><B> Sign Me Up Now >> </a><br></div>"; } ///////////////////////////////////////////////////////// // Signup primary form, info goes into 'users' table ///////////////////////////////////////////////////////// if ($step=="signup2") { //title echo "<h2>Account Creation</h2>"; //Post Variables I $username= mysql_escape_string(stripslashes($_POST ["username"])); $pass1= $_POST ["pass1"]; $pass2= $_POST ["pass2"]; $first= trim($_POST ["first"]); $last = trim($_POST ["last"]); //Post Variables II $address1= trim($_POST ["address1"]); $address2= trim($_POST ["address2"]); $city= trim($_POST ["city"]); $state= trim($_POST ["state"]); $country= trim($_POST["country"]); $zip= trim($_POST ["zip"]); $phone1= trim($_POST ["phone1"]); You can see that it has a link to signup2, but when you place the cursor on the link, it will say signup1. If you open it in a new window, it opens signup2. How do I correct this problem in firefox. IE is fine. Thanks, Tom Quote Link to comment Share on other sites More sharing options...
cags Posted October 8, 2009 Share Posted October 8, 2009 I'm not sure it's going to help any but it might. The code you have would be considered 'bad practice' in more than a few ways. Firstly it requires the server to have short_open_tags enabled and by the looks of it register_globals also. Whilst these are probably not the best idea, I'm not sure they could cause the problem you have. I guess it could be the HTML and the way it's being parsed. Ignoring the fact your using capitalized tags which I know alot of people hate, you don't have closing tags for your <b> or <li> tags, it would be a good idea to use http://validator.w3.org/ to check your code as if your code isn't validated getting different bahavior in different browsers is extremely likely. Having said all this I tested your code (after fixing the open tag to <?php and replacing $step = $page; with $step = $_GET['page']. And it works fine on FF 3.5.3. Quote Link to comment Share on other sites More sharing options...
Ohio Guy Posted October 8, 2009 Author Share Posted October 8, 2009 Thank you for you help. I will try to correct the html code to see if that helps. I bought the php script and am trying to learn more about php so I can make changes. Tom Quote Link to comment Share on other sites More sharing options...
Ohio Guy Posted October 8, 2009 Author Share Posted October 8, 2009 I'm not sure it's going to help any but it might. The code you have would be considered 'bad practice' in more than a few ways. Firstly it requires the server to have short_open_tags enabled and by the looks of it register_globals also. Whilst these are probably not the best idea, I'm not sure they could cause the problem you have. I guess it could be the HTML and the way it's being parsed. Ignoring the fact your using capitalized tags which I know alot of people hate, you don't have closing tags for your <b> or <li> tags, it would be a good idea to use http://validator.w3.org/ to check your code as if your code isn't validated getting different bahavior in different browsers is extremely likely. Having said all this I tested your code (after fixing the open tag to <?php and replacing $step = $page; with $step = $_GET['page']. And it works fine on FF 3.5.3. I made the changes that you made ( replacing $step = $page; with $step = $_GET['page'].), but it still does the same thing except that now it won't work when I open a new window. I also added the close tags in the html. Here is the new code. <?php //get _GET $step = $_GET['page']; ///////////////////////////////////////////////////////// // Sign Up Ad, gives details about signing up etc... ///////////////////////////////////////////////////////// if ($step=="signup1") { $cost = $cfg ["monthly_cost"]; echo "<div align=center><h1>Sign up here<BR><font size=2><B>Local Business Section.</font></h1><B><font size=4> Get a membership which allows you to post an unlimited number of coupons for one year.<p> <table width=65%><div align=left> You have complete control over your coupons and advertising.</b><UL> <LI>No more misprinted coupons with the wrong phone number, wrong product, or wrong price.</li> <LI>Make your changes instantly.</LI> <LI>Make your special offer available immediately.</LI> <LI>When coupons expire, they are removed automatically.</LI> <LI>Have your own page with your coupons on it.</li></ul></div></table> <P>"; echo "<a href='http://www.couponfile.net/couponscript5/couponsite/index.php?page=signup2'><font size=5><B> Sign Me Up Now >> </a><br></div>"; } ///////////////////////////////////////////////////////// // Signup primary form, info goes into 'users' table ///////////////////////////////////////////////////////// if ($step=="signup2") { //title echo "<h2>Account Creation</h2>"; Quote Link to comment Share on other sites More sharing options...
nicephotog Posted October 11, 2009 Share Posted October 11, 2009 put these two metas into the head of your html output in that script. <meta http-equiv="pragma" content="no-cache"> and for this second you will need to a little with the PHP date function to print it/fill in the time/date section correctly at the moment it generated the response to the user.(example) <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> Quote Link to comment Share on other sites More sharing options...
Ohio Guy Posted October 12, 2009 Author Share Posted October 12, 2009 Thank you for the help. I will check this out. Tom put these two metas into the head of your html output in that script. <meta http-equiv="pragma" content="no-cache"> and for this second you will need to a little with the PHP date function to print it/fill in the time/date section correctly at the moment it generated the response to the user.(example) <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> Quote Link to comment Share on other sites More sharing options...
Ohio Guy Posted October 13, 2009 Author Share Posted October 13, 2009 Thank you for the help. I will check this out. Tom put these two metas into the head of your html output in that script. <meta http-equiv="pragma" content="no-cache"> and for this second you will need to a little with the PHP date function to print it/fill in the time/date section correctly at the moment it generated the response to the user.(example) <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> I tried this and I still have the same problem. The Firefox browser will not go to the signup2 from signup1 using the link. It will only go to signup 2 if I put the url in the url section of the browser manually. It works fine in IE. Thanks, Tom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.