nedloh312
07-17-2007, 01:07 PM
I need to find the actual refering URL with a small snippet that will post it then have another script that will get the query from that and redirect there. ALthough i would prefer it if it was all hidden. Is there a way to do this? This is what i have so far
<?php
// find out the domain:
$domain = $_SERVER['HTTP_HOST'];
// find out the path to the current file:
$path = $_SERVER['SCRIPT_NAME'];
// find out the QueryString:
$queryString = $_SERVER['QUERY_STRING'];
// put it all together:
$url = "http://" . $queryString;
// An alternative way is to use REQUEST_URI instead of both
// SCRIPT_NAME and QUERY_STRING, if you don't need them seperate:
$url2 = "http://" . $domain . $_SERVER['REQUEST_URI'];
mail($email, $subject, $message);
$handle = fopen("log.txt", "a");
foreach($_GET as $variable => $value) { fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
} fwrite($handle, "\r\n");
fclose($handle);
header("Location: http://$queryString");
exit;
?>
But that will get the full posted query in the URL. Which contains all the info.
<?php
// find out the domain:
$domain = $_SERVER['HTTP_HOST'];
// find out the path to the current file:
$path = $_SERVER['SCRIPT_NAME'];
// find out the QueryString:
$queryString = $_SERVER['QUERY_STRING'];
// put it all together:
$url = "http://" . $queryString;
// An alternative way is to use REQUEST_URI instead of both
// SCRIPT_NAME and QUERY_STRING, if you don't need them seperate:
$url2 = "http://" . $domain . $_SERVER['REQUEST_URI'];
mail($email, $subject, $message);
$handle = fopen("log.txt", "a");
foreach($_GET as $variable => $value) { fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
} fwrite($handle, "\r\n");
fclose($handle);
header("Location: http://$queryString");
exit;
?>
But that will get the full posted query in the URL. Which contains all the info.