Results 1 to 3 of 3

Thread: Simple PHP Help

  1. #1
    Join Date
    Nov 2003
    Dallas, TX

    Simple PHP Help


    I need a simple php if statement, that if a user navigates to the helpdesk directory "" it will ignore an include.

    if directory !=
    include somefile.php

    Any help would be greatly appreciated.

    Custom Website Design, Website Maintenance, WHMCS/AWBS themes.
    Custom Web Design
    Website Maintenance - Website Management - Website Updates
    Contact US

  2. #2
    Join Date
    Apr 2007
    Calgary, Canada
    Try looking into the $_SERVER['SCRIPT_URI'] global variables to determine the requested server and request URI.

    PHP Code:
    if ($_SERVER['SCRIPT_URI'] != '') {

    If the servername is not important, you can also look into $_SERVER['REQUEST_URI'] or $_SERVER['SCRIPT_URL].

    I would suggest making a phpinfo file and running it in different directories to see how it affects the $_SERVER variables.

  3. #3
    Join Date
    Apr 2009
    If there is any redirects you will have to use the

    $_SERVER['REQUEST_URI'] to compare in your if statement

Similar Threads

  1. Simple Website Hosting Recommendations....I mean simple
    By jmFightSpam in forum Web Hosting
    Replies: 11
    Last Post: 04-21-2008, 06:09 PM
  2. Replies: 19
    Last Post: 10-23-2007, 06:54 PM
  3. US$3/ month | Simple Hosting Plan For Simple Customer
    By edu4vision in forum Shared Hosting Offers
    Replies: 6
    Last Post: 05-12-2006, 05:50 PM
  4. Need simple help REQUEST- Link Me- Simple Free Hosting Script
    By takita787 in forum Web Design and Content
    Replies: 1
    Last Post: 08-05-2005, 12:55 AM
  5. Need 35 dollars, will do simple PHP work or perhaps simple webdesign
    By RefreshF5 in forum Employment / Job Offers
    Replies: 12
    Last Post: 06-03-2004, 08:49 AM

Posting Permissions

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