GET[''pid'']; //we create an object of a fictional class Page $obj = new Page; $content = $obj->fetchPage($pid); //and now we have a bunch of PHP that displays the page ?>
GET[''pid'']; if (is_numeric($pid)){ //we create an object of a fictional class Page $obj = new Page; $content = $obj->fetchPage($pid); //and now we have a bunch of PHP that displays the page }else{ //didn''t pass the is_numeric() test, do something else! } ?>
GET[''pid'']; if (strlen($pid)){ if (!ereg(”^[0-9]+$”,$pid)){ //do something appropriate, like maybe logging them out or sending them back to home page } }else{ //empty $pid, so send them back to the home