GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   any php guys around? how can i do this? (https://gfy.com/showthread.php?t=183502)

lil2rich4u2 10-07-2003 02:06 PM

any php guys around? how can i do this?
 
this is obviously not the code, but i dont know how else to explain it to you ...


if ($referrer != *.domain.com) {
redirect to error page
halt
}

if ($referrer = *.domain.com) {
redirect to correct page
halt
}

basically i want to send the surfer through a script that will check referrer, and if he did not come from a specific page i want him sent to an error page.

if he did come from specific page, i want him sent to a different page.

also it must strip the referrer and only look at the domain, and not the trailing sub domains.


if this is complicated, shoot me a quote to [email protected]

thanks.

lil2rich4u2 10-07-2003 02:15 PM

job is done

thanks xascripts

Nathan 10-07-2003 02:21 PM

Hey lil,

Code:


$refinfo = parse_url($_SERVER['HTTP_REFERER']);
$levels = explode('.', $refinfo['host']);
$toplevel = array_pop($levels);
if (count($levels)) $dom = array_pop($levels).'.'.$toplevel;

if ($dom hahahaha 'okdomain.com') {
  Header('Location: http://www.okurl.com/page.html');
} else {
  Header('Location: http://www.badurl.com/page.html');
}
exit;

You could also use regex to do all this, but this should work just as well. Do not want to think of a weird regex to filter out a domain right now <G>

detoxed 10-07-2003 02:35 PM

lil2rich4u2 is a dildo

grumpy 10-07-2003 03:05 PM

better do that in .htaccess . No extra sever load.


All times are GMT -7. The time now is 10:27 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123