Php redirects

Status
Not open for further replies.

eclipsenetworkz

New member
Mar 12, 2007
87
1
0
Hi,

I use a redirect on this page

http://www.shoppingbounce.com/6/sea...ndid=&marid=&storename=&brandname=&brandname=

Notice that on the goto.php page it takes about 1 second before going to the merchant page.

I really need this redirect to be more instantaneous. However, I must at least redirect through the goto.php page because that is where my tracking occurs. Any idea how I can increase the speed of the redirect.

I currently use this code.

<?php
foreach($_POST as $key => $value) {
$$key = $value;
}
foreach($_GET as $key => $value) {
$$key = $value;
}
$w = $_GET['w'];

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Shoppingbounce.com: <? echo $w; ?></title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=<? echo $w; ?>">

When I change the CONTENT="1 to a 0 it doesn't seem to affect anything, when I change it to 5 it doesn't make it take 5 seconds. So I'm confused.

Is there a better way to do this?
 


In addition to the META refresh, add some javascript that will redirect immediately. Leave the META refresh there in case the visitor's javascript is disabled.

HTML:
<script type="text/javascript">
window.location='http://www.google.com';
</script>
 
If I use the javascript, would it be like this for inputting the url,

<script type="text/javascript">
window.location='<? echo $w; ?>';
</script>
 
Code:
<?php
foreach($_POST as $key => $value) {
$$key = $value;
}
foreach($_GET as $key => $value) {
$$key = $value;
}
$w = $_GET['w'];

wtf are you playing with all the vars for? If you have for sure a $_GET['w'] then just do a $w=$_GET['w']. You're not doing anything with the other stuff. It's not slowing you down, but it's messy :P


Code:
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=<? echo $w; ?>">

Are you _sure_ that changing 1 to 0 doesn't make it faster here? According to Meta refresh - Wikipedia, the free encyclopedia , that number's supposed to measure exactly that.
 
Status
Not open for further replies.