Hello Friends,
I am have trouble with redirection.
To a file i am passing a url as parameter. It is working fine for some urls but for some urls its not re-directing properly. It gives File not found error, but when i type the url in the browser it works properly.
<?
$filename="Location: ".urldecode($_GET{url});
header($filename);
?>
example of url :
?url=http://www.qksrv.net/click-1167113-1027 ... D%3D334656'
thanks
heydude517
Need Help With Re-Direction
Moderator: General Moderators
Its as it is
Hi friend,
The url it self is like that.
test.php?url=http://www.qksrv.net/click-1167113-1027 ... D%3D334656
the actual url to redirect also contains a variable called url.
thanks for help
heydude517
The url it self is like that.
test.php?url=http://www.qksrv.net/click-1167113-1027 ... D%3D334656
the actual url to redirect also contains a variable called url.
thanks for help
heydude517
I'm still not sure why you are redirecting to a site that redirects you..why not just redirect straight to http://www.softwarenirvana.net ?
Re: Need Help With Re-Direction
Try something like this:
Code: Select all
<?php
// old
$filename="Location: ".urldecode($_GET{url});
header($filename);
// new
$location = $_GET['url'];
$location = urldecode($location);
header ("Location: $location");
?>Hi
Hi Friends,
I tried the above too, but its not working...
But when i write :
<?
$pieces=explode("=",$url);
$url1=$pieces[0]."=";
for($i=1;$i<count($pieces);$i++)
{
$url1.=urlencode($pieces[$i]);
if($i!=(count($pieces)-1))
{
$url1.=urlencode("=");
}
}
print "<script> window.location.href=\"$url1\"; </script>";
?>
Its working ...
But i want to konw why the Header("Location : $location "); didn't workout...
What was i missing ?? or something else went wrong?
Thanks
I tried the above too, but its not working...
But when i write :
<?
$pieces=explode("=",$url);
$url1=$pieces[0]."=";
for($i=1;$i<count($pieces);$i++)
{
$url1.=urlencode($pieces[$i]);
if($i!=(count($pieces)-1))
{
$url1.=urlencode("=");
}
}
print "<script> window.location.href=\"$url1\"; </script>";
?>
Its working ...
But i want to konw why the Header("Location : $location "); didn't workout...
What was i missing ?? or something else went wrong?
Thanks