I am getting 2 address in the browser window so I am getting an error. This is on GoDaddy. I’m thinking maybe a change in the php might fix it because it seems to be bringing up the domain the redirect is coming from.
Example:
my site.com – trying to redirect to an external site after the submit button in the form is submitted.
It redirects me to:
http://www.mysite/ http://external_site
instead of just: external_site.com
Any help would be great as I am totally lost on this…
The redirect is in a hidden field in a form. It is using GoDaddy’s php which is below:
<?php
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET"){
$query_vars = $_GET;
} elseif ($request_method == "POST"){
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");
$file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
$fp = fopen($file,"w");
while (list ($key, $val) = each ($query_vars)) {
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
fputs($fp,"$val\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
if ($key == "redirect") { $landing_page = $val;}
}
fclose($fp);
if ($landing_page != ""){
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
} else {
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}
?>
Remove
$_SERVER["HTTP_HOST"]in the first header …