rcinformatica
asked on
Php Redirect
Hi Experts,
I need to create a PHP page that redirects to namedrive.com, the destination URL should be:
http://www.ndparking.com/nameofdomain.com
this is the script:
<?
$domain = $_SERVER['HTTP_REFERER'] ;
$dest = "http://www.ndparking.com/";
echo "redirecting please wait";
header("location: $destinazione$domain");
exit;
?>
but I cannot get it to work,
could you help me please
I need to create a PHP page that redirects to namedrive.com, the destination URL should be:
http://www.ndparking.com/nameofdomain.com
this is the script:
<?
$domain = $_SERVER['HTTP_REFERER'] ;
$dest = "http://www.ndparking.com/";
echo "redirecting please wait";
header("location: $destinazione$domain");
exit;
?>
but I cannot get it to work,
could you help me please
or, if you really want the "redirecting" to be shown, use the META tag:
<?
$domain = $_SERVER['HTTP_REFERER'] ;
$dest = "http://www.ndparking.com/";
echo "<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"5; URL=$destinazione$domain\" >";
?>
<?
$domain = $_SERVER['HTTP_REFERER'] ;
$dest = "http://www.ndparking.com/";
echo "<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"5; URL=$destinazione$domain\"
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
then, $_SERVER['HTTP_REFERER'] returns nothing, possibly the server setting is not enabled to fill in that value?
ASKER
thanks I believe you are right, what I need to do is :
I type the URL in the browser http://www.name.com
the script redirects to http://www.ndparking.com/name.com
could you help me getting this script
thanks
I type the URL in the browser http://www.name.com
the script redirects to http://www.ndparking.com/name.com
could you help me getting this script
thanks
Addtionaly, some browsers are configured not to send a http_referer header at all (as is mine).
-r-
-r-
'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the
current page. This is set by the user agent. Not all user agents will set
this, and some provide the ability to modify HTTP_REFERER as a feature. In
short, it cannot really be trusted.
Don't forget that people can start with a blank page on the browser and jump
to your page, in that case you too get a blank data.
The address of the page (if any) which referred the user agent to the
current page. This is set by the user agent. Not all user agents will set
this, and some provide the ability to modify HTTP_REFERER as a feature. In
short, it cannot really be trusted.
Don't forget that people can start with a blank page on the browser and jump
to your page, in that case you too get a blank data.
ASKER
Hi I changed HTTP_REFERER with HTTP__HOST and it works now thanks
HTTP_HOST always refers to the server the script is running from. Hence always being: ndparking.com.
-r-
-r-
-r-