Jump to content
MakeWebGames

Recommended Posts

Posted

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 :?

Posted

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.

Posted

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'; }

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...