Selectively Displaying Text

From: Anonymous Poster (anonymous_at_anonymousplace.com)
Date: 12/29/03


Date: Mon, 29 Dec 2003 02:31:16 GMT

Hello Everyone,

This is probably very simple but I am missing it here. I have a file called
"header.php" which is included on every one of my other PHP pages. If the
page it's being included on is named "index.php" then I do not want to
display certain text. Otherwise I want it there. The code I am using now is:

if($_SERVER['PHP_SELF'] == "index.php"){
    display_text;
}

But that doesn't work. I am assuming that this is because "technically" the
page name is "header.php" which is INCLUDED on "index.php". Is this correct?
Either way, how can I accomplish this goal?

Thanks!
Anthony



Relevant Pages

  • Re: [PHP] Pragmatically changing a "Record Number"
    ... Let's say the PHP list has message numbers and this post is number ... field in the database to accomplish what you are trying to do. ... increments by one for each row you display. ... "Some men are born to greatness, some achieve greatness, ...
    (php.general)
  • Conditional statement not working
    ... is a template. ... What am I missing? ... // display page ...
    (comp.lang.php)
  • Re: Need Repaired, WTB, or WTT Sys 11,11a,11b MPU
    ... segments that are missing vary from display test to display test. ...  Besides that the game will play. ...
    (rec.games.pinball)
  • Re: Object Oriented Content System - the idea
    ... >I expected php to be smarter then that. ... >form like bytecode in memory for the next request. ... each action added some stuff to a "response" XML document. ... that map/object/data and formats it for HTML display using an includeed PHP ...
    (comp.lang.php)
  • Re: session trouble
    ... Note that you're building your display block AFTER your loop. ... <?php session_start; ... The problem here is going to be since you have multiple school clubs, it's going to be hard to relate a particular club to the entry in your database if it going to be changed. ... Another way is to add a suffix to each field, often times the primary key for the table. ...
    (comp.lang.php)