|   |   |   | ||||
| Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. | 
| 
 | |||||||
| New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. | 
|  | Thread Tools | 
|  07-23-2009, 09:43 PM | #1 | 
| Confirmed User Industry Role:  Join Date: Jan 2007 Location: Gamehendge 
					Posts: 1,340
				 | 
				
				php question
			 wanting to store sitename as a php variable. if url was www somesitename .com i want my page to pull "somesitename" and store as php variable, without the www or the .com any thoughts? | 
|   |         | 
|  07-23-2009, 10:12 PM | #2 | 
| Confirmed User Industry Role:  Join Date: May 2003 
					Posts: 3,765
				 | where is it pulling 'somesitename' from?  from the url it's located at? Code: <? $somesitename = $_SERVER['SERVER_NAME']; $somesitename = str_replace( 'www.', '', $somesitename); $somesitename = str_replace( '.com', '', $somesitename); print $somesitename; ?> 
				__________________ flexx [dot] aeon [at] gmail | 
|   |         | 
|  07-23-2009, 11:33 PM | #3 | 
| Registered User Industry Role:  Join Date: May 2009 Location: Orange County, CA 
					Posts: 94
				 | Code: $domain_strip = preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $_SERVER['HTTP_HOST']);
$domain = substr($domain_strip, 0, strpos($domain_strip, ".")); | 
|   |         | 
|  07-26-2009, 03:50 AM | #4 | |
| Confirmed User Join Date: Feb 2002 Location: ICQ: 251425 Fr/Au/Ca 
					Posts: 6,863
				 | Quote: 
 Try: Code: echo parse_url($u,PHP_URL_HOST); | |
|   |         | 
|  07-27-2009, 05:33 AM | #5 | |
| Confirmed User Industry Role:  Join Date: Nov 2008 
					Posts: 2,491
				 | Quote: 
  
				__________________ | |
|   |         |