Link to home
Start Free TrialLog in
Avatar of SOUANI
SOUANI

asked on

meta http-equiv="refresh" DOESN'T WORK AT GOOGLE CHROME BROWSER

Hi!
Can you help me with this ?  I have a page with a meta tag for refresh into another page regarding the url ID I have.  It works fine at IE, firefox, Safari but not in Google Chrome.
If your type in all other browsers :  www.justclick4.info/home.php?RecordID=1   goes to a page I have specify and if I type www.justclick4.info/home.php?RecordID=2 goes to an other page.
But in Google Chrome it doesn't.
<html><head><meta http-equiv="refresh" content="0;url=http://<?php echo $row_levels['link_stratol']; ?>?RecordID=<?php echo $row_levels['site_id']; ?>"></head>

Open in new window

Avatar of oobayly
oobayly
Flag of United Kingdom of Great Britain and Northern Ireland image

Seeing as you're using php and immediately redirecting the page, why don't you just do a 301 redirect.
This article explains about writing the Location header to redirect
http://www.phpf1.com/tutorial/php-redirect.html

Have a look at this w3c article explaining why you should use server side redirects.
http://www.w3.org/QA/Tips/reback
Avatar of SOUANI
SOUANI

ASKER

Thanks for the answer I know this redirect with Location Header but I how I will put t :  http://<?php echo $row_levels['link_stratol']; ?>?RecordID=<?php echo $row_levels['site_id']; ?>"> in the place of the url of the redirect ?   YOu cant write it like this. This works only inside html tags.

I dont know the right syntax.  I can do it with plain url ig. www.justclick4.info/index.php but I want to retrieve the url for my database

thank you
Penelope
Avatar of SOUANI

ASKER

to help you figure out what I am trying to do please see this:

How to write correct this code ?
<?php
    header('Location:http://$row_levels['statol_level']?RecordID=$row_owners['site_id']');
    die();
   
?>

like this I am getting an error
thank you ..

Just concatenate the variables:
<?php
  header('Location:http://' . $row_levels['statol_level'] . '?RecordID=' . $row_owners['site_id']);
  die();
?>

Open in new window

Avatar of SOUANI

ASKER

Hi!

I have put the suggested code but as you can see yourself it doesn't work.  url:  www.justclick4.info/home.php?RecordID=1

The url in my db are like this :  www.justclick4.info/index5.php (this is the field statol_level in table levers in mysql.
I assume I have them correct as the code you send me is like this Location:http://' . $row_levels['statol_level'] . '?RecordID=' . $row_owners['site_id']);

thank you
ASKER CERTIFIED SOLUTION
Avatar of oobayly
oobayly
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial