I posted this on the vBulletin forums as well, hopefully someone can help me here. I would appreciate any help.
Hi guys,
I've set up a script on our forums to track all outgoing clicks. Right now, any url that is posted on our forums automatically goes through a goto.php file, which logs where the user is going, and automatically redirects them there.
What I'd *LIKE* to have is something similar to Hotmail, where the window that opens up for the user has a small frame at the top, which says "You are visiting a site outside of XYZ, click here to return to XYZ, etc. and the url they're going to would open in the lower frame.
The following is the code from the goto.php file. I'd appreciate if someone could point me in the right direction on how to get this done. I have *NO CLUE* about php, so I'd need to know exactly what to add/remove?
Thanks in advance!
Code:<?php // Necessary Variables: $COUNT_FILE = "/home/bigforum/public_html/data/datac0.txt"; // En: Absolute path and name to count data file. // Fr: Chemin absolu (complet) et Nom du fichier compteur. // End Necessary Variables section /******************************************************************************/ function error ($error_message) { echo $error_message."<BR>"; exit; } $url = urldecode($QUERY_STRING); if (! file_exists($COUNT_FILE)) error("Can't find file, check '\$COUNT_FILE' var..."); if ((! $url) || (! preg_match("/http:/", $url))) error ("Invalid url, you chould add url ex: <A HREF=\"http://$SERVER_NAME$PHP_SELF?http://www.ftls.org/\">http://$SERVER_NAME$PHP_SELF?http://www.ftls.org/</A>"); $file_arry = file($COUNT_FILE); //or error("Can not open \$COUNT_FILE"); while (list($key, $val) = each($file_arry)) { if ($val != "") { list($file_url, $nb) = preg_split("/\t|\n/", $val); if ($file_url == $url) { $nb++; $file_arry[$key] = "$file_url\t$nb\n"; $find = 1; } } } $file = join ("", $file_arry); if (! $find) $file .= "$url\t1\n"; $fp = fopen("$COUNT_FILE", "w"); //or error("Can not open \$COUNT_FILE"); flock($fp, 1); fputs($fp, $file); flock($fp, 3); fclose($fp); header("Location: $url"); ?>






Bookmarks