PHPBuilder - Go Away ! Basic safeguard for pages

RSS Twitter

Go Away ! Basic safeguard for pages

by: Peter Garner
December 13, 2002

I built a series of WAP pages which required a single PIN to access the final page. Each page normally passes on the $PIN variable. I wanted to ensure that an opportunistic viewer could not just go straight to the final page, so I used a simple variable test prior to sending the real header. Therefore if the variable $PIN is not set, you'll get a "page not found" error. Don't trust National Secrets to this scheme, but to deter Mr Average it works fine :-)

if ( empty($PIN) )
        header("HTTP/1.0 404 Not Found");

header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?&gt;";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
        . " \"\"&gt;";
.... etc

Comment and Contribute

Your comment has been submitted and is pending approval.

Peter Garner



(Maximum characters: 1200). You have characters left.