PDA

View Full Version : A programming question...



thrawn
August 20th, 2006, 05:29 AM
Some of you might know that for the present, my main stream of internet based income is from webdesign and programming (still waiting for my clickbank affilate site to be placed onto the great google). However there's one thing that i don't know how to do, and it has been bugging me for ages:

Take this url:

www.$name.url.extension

How do i draw down the variable name from the url? I have seen sites that do it, but i myself cannot :( If anyone could help me out it would be most appreciated (Preferably in php)

Thank you

Thrawn

Lpspider
August 20th, 2006, 05:09 PM
I'm not sure what you mean... shorten it, so to speak?

thrawn
August 21st, 2006, 04:56 AM
How do I make the sub domain into a variable e.g.:

www.thrawn.website111.net (the 111 is to stop redirection to a real site)

How do i turn the Thrawn part into a variable? Like on those sites a while back, www.person.youvebeenowned.com or something like that.

SinoMan
August 21st, 2006, 05:43 AM
OMFG! That's probably the first programming problem I have not successfuly Googled yet :angry: :angry: :angry:

Anyway bro, it's http://person.justgotowned.com/ :lol:

kasodo
August 21st, 2006, 10:13 AM
Try this:

$url = 'http://something.mypage.com/blah';
$url_components = parse_url($url);
$host_components = explode('.', $url_components['host']);
$result = $host_components[0];
echo $result;


Some of you might know that for the present, my main stream of internet based income is from webdesign and programming (still waiting for my clickbank affilate site to be placed onto the great google). However there's one thing that i don't know how to do, and it has been bugging me for ages:

Take this url:

www.$name.url.extension

How do i draw down the variable name from the url? I have seen sites that do it, but i myself cannot :( If anyone could help me out it would be most appreciated (Preferably in php)

Thank you

Thrawn

thrawn
August 21st, 2006, 02:14 PM
Thank you everyone for your help :D I wasn't sure if it was possible or not, out of interest, does anyone know a really good book/site/resource for advanced codes in php that aren't mainstream? I know all of the mainstream stuff; however I need to add some spice :D

Thank you again

Thrawn :)

SinoMan
August 22nd, 2006, 07:06 AM
Thank you everyone for your help :D I wasn't sure if it was possible or not, out of interest, does anyone know a really good book/site/resource for advanced codes in php that aren't mainstream? I know all of the mainstream stuff; however I need to add some spice :D

Thank you again

Thrawn :)

php.net ^^

alien23
February 5th, 2007, 01:49 PM
Some of you might know that for the present, my main stream of internet based income is from webdesign and programming (still waiting for my clickbank affilate site to be placed onto the great google). However there's one thing that i don't know how to do, and it has been bugging me for ages:

Take this url:

www.$name.url.extension

How do i draw down the variable name from the url? I have seen sites that do it, but i myself cannot :( If anyone could help me out it would be most appreciated (Preferably in php)

Thank you

Thrawn

Interesting to see who will get you the soultion as this looks complicated for sure and infact i definitely cannot do it for you