Page 1 of 1

Display Browser URL on webpage

Posted: Wed Apr 11, 2007 11:04 am
by sbridge
I am attempting to create a parked page, but I'm having some difficulties with getting something the way I'd like it.

I want someone to be able to log onto the website and by automation, have it display the URL and say "is parked."
eg: http://www.devnetwork.net is parked

I would like it to pull the url from the browser... this way I don't have to manually enter it on each domain I park.

I was browsing through some javascripts, but no luck there and then I thought maybe I might get lucky here... any suggestions?

thnx :D

found this, but so confused

Posted: Wed Apr 11, 2007 11:07 am
by sbridge
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I found this, but I have no clue what to do with this... 


"

Code: Select all

<?php 
function selfURL() { 
    $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; 
    $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; 
    $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); 
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; 
} 
function strleft($s1, $s2) { 
    return substr($s1, 0, strpos($s1, $s2)); 
} 
?>

so you can use it by invoking selfURL() function "


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Apr 11, 2007 11:39 am
by RobertGonzalez
$_SERVER['HTTP_HOST'];

Posted: Wed Apr 11, 2007 11:44 am
by feyd
I would use the function posted by Burrito some time ago called getURL. It's a bit more straight-forward.

viewtopic.php?t=37950&highlight=geturl

Sweet!

Posted: Wed Apr 11, 2007 11:53 am
by sbridge
awesome... you guys rock! thanks!