inferno564 Posted May 17, 2009 Posted May 17, 2009 i am coding a new newspaper ,but i don't want the header.php to be used, but i still want to use the global.php. so is there a way to use the header for only some pages. ex: if page=newspaper.php include "mainmenu.php"; } else { require "header.php"; something like that. is there a way to do this :? Quote
AlabamaHit Posted May 17, 2009 Posted May 17, 2009 Re: help with coding display http://us2.php.net/manual/en/reserved.v ... server.php Quote
mikemastah Posted May 17, 2009 Posted May 17, 2009 Re: help with coding display I suppose you could use something like $currentpage=addslashes($_SERVER['PHP_SELF']); if ($currentpage == 'newspaper.php') { include "mainmenu.php"; } else { require "header.php"; } which is probably what AlabamaHit meant. Quote
CrazyT Posted May 17, 2009 Posted May 17, 2009 Re: help with coding display I suppose you could use something like $currentpage=addslashes($_SERVER['PHP_SELF']); if ($currentpage == 'newspaper.php') { include "mainmenu.php"; } else { require "header.php"; } which is probably what AlabamaHit meant. Why addslashes?... if($_SERVER['PHP_SELF'] == '/newspaper.php') { include_once 'mainmenu.php'; } else { include_once 'header.php'; } Quote
mikemastah Posted May 17, 2009 Posted May 17, 2009 Re: help with coding display Because in php you could go to example.com/script.php/maliciousxsscode and that would show up in $_SERVER['PHP_SELF'] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.