SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php Operator "OR"

    Code:
    <?php
     if ($_SERVER['PHP_SELF'] !== '/page.php/') { print 'something here'; } ?>
    this works but I'm trying to get it to not print something on two different pages. Like this:

    Code:
    <?php
     if ($_SERVER['PHP_SELF'] !== '/page.php/' || '/another-page.php') { print 'something here'; } ?>
    this dosen't work.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,834
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    if ($_SERVER['PHP_SELF'] !== '/page.php/' && $_SERVER['PHP_SELF'] !== '/another-page.php') { ...
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks felgall

    That works


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •