Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URL on a PHP variable

Status
Not open for further replies.

JMamede

IS-IT--Management
Jun 9, 2008
2
PT
HI.

I need to filter my logins to a certain URL, since I have a URL for web use and an internat intranet login.

I have to get the URL on the browser and put in a PHP variable, and I think that only with Javascript I can do this.

Thanks
 
If I understand you correctly you are wanting to detect where a site is hosted in order to treat login detais differently?


Try checking the HHTP_HOST server global.

Code:
if($_SERVER['HTTP_HOST']=="[URL unfurl="true"]www.mydomain.co.uk"[/URL] || $_SERVER['HTTP_HOST']=="mydomain.co.uk"){
    .... do something ....
} else {
    .... do something else ....
}

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Hang on, I thought I was in the PHP forum.

The code I posted is PHP, you don't need to do it client side if I was correct in understanding your requirements.

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top