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)
-   -   php help (https://gfy.com/showthread.php?t=718796)

ztik 03-27-2007 07:01 PM

php help
 
anyone know how to take a subdomain sub and put it into a link

IE

I have the domain

http://SUB.domain.com

I want to take a sub domain and make it at the end of a link

http://www.someotherdomain.com/SUB

nestle 03-27-2007 07:13 PM

Code:

<?
// this separates it into an array [0]=>sub, [1]=>domain, [2]=>tld
$exploded = explode(".", $_SERVER['HTTP_HOST']);

// just redirects to http://someotherdomain.com/sub
header("Location: http://www.someotherdomain.com/" . $exploded[0]);
?>

untested but should work.

ztik 03-27-2007 07:17 PM

Quote:

Originally Posted by nestle (Post 12158290)
Code:

<?
// this separates it into an array [0]=>sub, [1]=>domain, [2]=>tld
$exploded = explode(".", $_SERVER['HTTP_HOST']);

// just redirects to http://someotherdomain.com/sub
header("Location: http://www.someotherdomain.com/" . $exploded[0]);
?>

untested but should work.


cool i'll try it, thanks for the help


All times are GMT -7. The time now is 03:29 AM.

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