Code: 
<?php
    
//logs the reffer
    $previous = $_SERVER['HTTP_REFERER'];
    
    
//writes the info to a file called logfile.html
$myFile = "logfile.html";
    $fh = fopen($myFile, 'a') or die("can't open file");
        $stringData = $previous . "<br />";
            fwrite($fh, $stringData);
                fclose($fh);
?>
    
<!-- redirects the user to the previous page.  //-->
<script type="text/javascript">
<!--
window.location = "<? echo $previous; ?>"
//-->
</script>
I believe that's what you are looking for, however if you want it mysql based, then let me know and I'll code you something up
Bread Reviewed by Bread on . Help with PHP Script. I need help making a script for a little project what i need is. <? php Site they came from ( LOG ) After submission send them back to that site /?php> Rating: 5