Re[4]: [PHP] Pulling data out of browser address bar

From: Date: Fri, 23 Aug 2002 21:54:12 +0000
Subject: Re[4]: [PHP] Pulling data out of browser address bar
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113860@lists.php.net to get a copy of this message
This is close to what I want but I don't what to redirect them I just want to get what is in the URL so I can but it in a variable to use on the web page. I have a lot of domain names all pointing to one domain and I want to be able to put "WELCOME TO TheDomannamethaytypedin.com" at the top of the page depending on what domain they typed into the URL. They will not be coming from another page they will most likely be typing the URL in Friday, August 23, 2002, 2:22:21 PM, you wrote: SJNHBe> This probably isn't doing what you want but it will illustrate how to get SJNHBe> the location. SJNHBe> <script language="javascript"> SJNHBe> <!-- SJNHBe> function checklocation(goodurl) { SJNHBe> if (self.window.location != goodurl) { SJNHBe> self.window.location = goodurl; SJNHBe> } SJNHBe> } -->> SJNHBe> </script> SJNHBe> Bascially you call checklocation with the url they should be at, if they SJNHBe> aren't at that url it will redirect them to their URL. SJNHBe> I use this script by placing and onLoad event in the <body> tag, an example SJNHBe> is <body style="font-family: Arial" bgcolor="FFFFFF" SJNHBe> SJNHBe> onLoad="checklocation('http://www.yoursite.com/login.php')"> SJNHBe> I created this script because some people were only going to yoursite.com SJNHBe> instead of www.yoursite.com, this caused sessions not to work because the SJNHBe> browser was not sending the cookies with the request because the cookies SJNHBe> were for www.yoursite.com. SJNHBe> Jason SJNHBe> -----Original Message----- SJNHBe> From: rdkurth@starband.net [mailto:rdkurth@starband.net] SJNHBe> Sent: Friday, August 23, 2002 3:24 PM SJNHBe> To: php-general SJNHBe> Subject: Re[2]: [PHP] Pulling data out of browser address bar SJNHBe> Hello Kevin, SJNHBe> I don't what to know where that came from I what to know what is in SJNHBe> the Address bar of the browser. They might not be coming from anywhere SJNHBe> they might have just typed the url in. I will look at doing it with SJNHBe> Javascript SJNHBe> Friday, August 23, 2002, 1:21:10 PM, you wrote: KS>> You can do it with Javascript but there's no need. $HTTP_REFERER is SJNHBe> what KS>> you want. It'll tell you where your users are coming from. So you'll SJNHBe> know KS>> if they have been redirected from one your other domains. KS>> -Kevin KS>> ----- Original Message ----- KS>> From: <rdkurth@starband.net> KS>> To: "php-general" <php-general@lists.php.net> KS>> Sent: Friday, August 23, 2002 2:19 PM KS>> Subject: [PHP] Pulling data out of browser address bar >>> Is there any way to tell what was typed in the browser to get to the >>> web page. >>> What I have is domain names that forward to a main domain and I >>> want to know what they typed in the browser to get to the main domain. >>> The way it is forwarded the browser retains what ever was typed >>> in the address bar. How can I pull what was typed into the address bar >>> this info into the web page. >>> >>> >>> >>> -- >>> Best regards, >>> rdkurth >>> mailto:rdkurth@starband.net >>> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> -- Best regards, rdkurth mailto:rdkurth@starband.net

« previous php.general (#113860) next »