Results 1 to 4 of 4
  1. #1

    whats wrong with this simple code?

    I have this code in the head tag of my site, but for some reason test.txt is being inluded on all pages, can someone tell whats wrong with my code?

    if ($_SERVER[PHP_SELF] = "2.php")
    include 'test.txt';

  2. #2
    change into:
    PHP Code:
    if ($_SERVER[PHP_SELF] == "2.php")

    you mangled variable assignment with boolean operation.
    everyday is deadline

  3. #3
    Join Date
    Jul 2003
    You need
    PHP Code:
    if ($_SERVER['PHP_SELF'] == "2.php"
    == means compare
    = means assign

    You should always quote your array keys. Unquoted text is considered a constant.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  4. #4
    thanks guys. its working now!

Posting Permissions

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