Jump to content

Why won't firefox open my link unless I select open in new window.


Ohio Guy

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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>";

 

 

 

Link to comment
Share on other sites

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">

Link to comment
Share on other sites

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">

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.