Checking an URL

From: Date: Wed, 23 May 2001 05:19:39 +0000
Subject: Checking an URL
Groups: php.general 
Request: Send a blank email to php-general+get-53986@lists.php.net to get a copy of this message
Hello Everybody :-) I've been trying to figure something out, but just cant find the right answer. I need some code to check that the page is being viewed from a specific url. EXAMPLE: Not just http://www but https://www1 if it is https://www1 then show the page otherwise echo a message. The reason is I don't want people to view certain pages without the secure server connection. I thought along these lines: $url=parse_url( some code to get the current URL); //Not sure how to do that part. if ($url[scheme] != 'https'){ echo "This page must be viewed on a secure connection - Please use the links"; }else{ Rest of Page Information } What do you rekon, Am i close or miles off. Any help would be really great. YoBro

« previous php.general (#53986) next »