Skip to content
WJunction - Webmaster Forum

Help with PHP Script.

Status
Not open for further replies.
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>
 

6 comments

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 :D
 
Bread, don't use javascript for that. Never use JS without an alternative for non-js users.

Use php's header() or a meta tag.
 
Status
Not open for further replies.

About the author

L
Banned · Joined
848
Messages
0
Reactions
16
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom