SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    nb canada
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error: PHP Notice: Undefined variable: PHP_SELF

    i have a "tag board" on my site. . and as does one of my clients and after upgrading my server and software it does not work right. . i got it from and it is http://www.cj-design.com/index.php?id=downloads&page=5 .. there support told me to edit a php file in apache and thats all they wanted to tell me .. but.. i thought id try here

    this is my error

    on page load

    [Tue Apr 01 01:47:50 2003] [error] PHP Notice: Undefined variable: PHP_SELF in c:\server\apache\htdocs\tag\display.php on line 9

    wen i go to make a post

    [Tue Apr 01 01:48:11 2003] [error] PHP Notice: Undefined variable: name in c:\server\apache\htdocs\tag\tag.php on line 7

    [Tue Apr 01 01:48:11 2003] [error] PHP Notice: Undefined variable: PHP_SELF in c:\server\apache\htdocs\tag\display.php on line 9

    i click submit or "tag" and it takes the post alright. . then the board refreshes and does not show up .. apache 1.3 onm win2kpro it uses a text file as a database not mysql database

    anyhelp would be a huge help

    thanks

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Can you post the code?? I am guessing that it has something to do with the PHP version....

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    nb canada
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    old version was 4.0.6

    new version I'm running is. . 4.3.1

    ill post the lines of code that have errors .. hope thats what you mean

    c:\server\apache\htdocs\tag\display.php on line 9

    print "<meta http-equiv=\"refresh\" content=\"$meta_refresh_rate; url=$PHP_SELF\">";


    in c:\server\apache\htdocs\tag\tag.php on line 7

    if($name == "" || $name == "Name" || $cjmsg == "" || $cjmsg == "Message"){ // if some idiot just clicks "tag"

    humm i cant see that last one being much to you. .

    i have a few topics of what the makers of the tagboard said to do .. i find "the guy" to be very rude .. but maybe its just me. here are some topics not sure what they meant..

    http://www.suzyweb.co.uk/james/forum...f7bdd66ad4a3a9

    http://www.suzyweb.co.uk/james/forum...f7bdd66ad4a3a9

    they keep saying to edit the php.inf. . or they said to edit POST method either way ... im lost

  4. #4
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Try replacing the instance of $PHP_SELF with $_SERVER['PHP_SELF'] and see if that fixes your one error.

  5. #5
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    nb canada
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [Thu Apr 17 20:01:45 2003] [error] PHP Notice: Undefined index: 'PHP_SELF' in c:\server\apache\htdocs\tag\display.php on line 9

    it did not seem to work

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    nb canada
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    pippo said this in my other post. .along with helping me to were to post this. .lol

    [QUOTE]I have the suspect that it's a "register globals" issue and in particular how you access your server-side variables.
    Examples:
    instead of $PHP_SELF
    you should use
    $_SERVER[ 'PHP_SELF' ]

    also
    instead of $name
    you should use
    $_POST[ 'name' ]QUOTE]

    i changed this in both files on every line and i got these errors

    [Fri Apr 18 00:34:32 2003] [error] PHP Notice: Undefined index: 'PHP_SELF' in c:\server\apache\htdocs\tag\display.php on line 9
    [Fri Apr 18 00:34:39 2003] [error] PHP Notice: Undefined variable: cjmsg in c:\server\apache\htdocs\tag\tag.php on line 7
    [Fri Apr 18 00:34:39 2003] [error] PHP Notice: Undefined index: 'PHP_SELF' in c:\server\apache\htdocs\tag\display.php on line 9

    did i stump the experts yet? ..lol i dont like this game

  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    nb canada
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i tryed another script on the server from

    http://www.mj-smile.com/en/index.php?page=php

    its an online counter box of some kind. . not aplug or anything just for ref

    and i got this

    [Thu Apr 24 02:50:13 2003] [error] PHP Warning: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: open(/tmp\sess_7d7d8b8b55daf7b208772b5a656d0f1e, O_RDWR) failed: No such file or directory (2) in c:\server\apache\htdocs\junk\onlinebox\login.php on line 54
    [Thu Apr 24 02:50:13 2003] [error] PHP Notice: Undefined variable: password in c:\server\apache\htdocs\junk\onlinebox\login.php on line 56
    [Thu Apr 24 02:50:13 2003] [error] PHP Notice: Undefined index: pass in c:\server\apache\htdocs\junk\onlinebox\login.php on line 56
    [Thu Apr 24 02:50:13 2003] [error] PHP Notice: Undefined variable: action in c:\server\apache\htdocs\junk\onlinebox\login.php on line 93
    [Thu Apr 24 02:50:13 2003] [error] PHP Notice: Undefined variable: password in c:\server\apache\htdocs\junk\onlinebox\login.php on line 93
    [Thu Apr 24 02:50:13 2003] [error] PHP Notice: Undefined index: pass in c:\server\apache\htdocs\junk\onlinebox\login.php on line 93
    [Thu Apr 24 02:50:13 2003] [error] PHP Warning: session_destroy() [<a href='http://www.php.net/function.session-destroy'>function.session-destroy</a>]: Session object destruction failed in c:\server\apache\htdocs\junk\onlinebox\login.php on line 95
    [Thu Apr 24 02:50:13 2003] [error] PHP Notice: Undefined variable: PHP_SELF in c:\server\apache\htdocs\junk\onlinebox\login.php on line 109
    [Thu Apr 24 02:50:13 2003] [error] PHP Notice: Undefined variable: action in c:\server\apache\htdocs\junk\onlinebox\login.php on line 123
    [Thu Apr 24 02:50:16 2003] [error] PHP Warning: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: open(/tmp\sess_7d7d8b8b55daf7b208772b5a656d0f1e, O_RDWR) failed: No such file or directory (2) in c:\server\apache\htdocs\junk\onlinebox\login.php on line 54
    [Thu Apr 24 02:50:16 2003] [error] PHP Notice: Undefined variable: password in c:\server\apache\htdocs\junk\onlinebox\login.php on line 56
    [Thu Apr 24 02:50:16 2003] [error] PHP Notice: Undefined index: pass in c:\server\apache\htdocs\junk\onlinebox\login.php on line 56
    [Thu Apr 24 02:50:16 2003] [error] PHP Notice: Undefined variable: action in c:\server\apache\htdocs\junk\onlinebox\login.php on line 93
    [Thu Apr 24 02:50:16 2003] [error] PHP Notice: Undefined variable: password in c:\server\apache\htdocs\junk\onlinebox\login.php on line 93
    [Thu Apr 24 02:50:16 2003] [error] PHP Notice: Undefined index: pass in c:\server\apache\htdocs\junk\onlinebox\login.php on line 93
    [Thu Apr 24 02:50:16 2003] [error] PHP Warning: session_destroy() [<a href='http://www.php.net/function.session-destroy'>function.session-destroy</a>]: Session object destruction failed in c:\server\apache\htdocs\junk\onlinebox\login.php on line 95
    [Thu Apr 24 02:50:16 2003] [error] PHP Notice: Undefined variable: PHP_SELF in c:\server\apache\htdocs\junk\onlinebox\login.php on line 109
    [Thu Apr 24 02:50:16 2003] [error] PHP Notice: Undefined variable: action in c:\server\apache\htdocs\junk\onlinebox\login.php on line 123
    in my error log. .. so i think there is a HUGE problem

  8. #8
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not really, it has to do with the error_reporting level.

    add this line to the beginning of the code:

    PHP Code:
    error_reporting(7); 
    (7 is pretty low... check out www.php.net/error_reporting for more info.)

    and when you are writing your own, you need to check if a variable is set before checking its contents.

    PHP Code:
    if (isset($_SERVER['PHP_SELF']) && $_SERVER['PHP_SELF']=='somefile.php'
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  9. #9
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    nb canada
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you lost me. . sorry newbie here ... but will this make the scripts work?. . like im despret here and would like to get them running its been over 2 weeks and i cant add anything new. .

    thanks all the same but i need things sumed down a bit. .. a lot

  10. #10
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For help with coding to register_globals off, check out http://www.sitepoint.com/article/758
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  11. #11
    SitePoint Enthusiast abbey's Avatar
    Join Date
    Apr 2003
    Location
    Chicago
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Who upgraded what?

    You upgraded php to version 4.3.1? Or, you upgraded the board software?

    If your host upgraded you to the latest version of php then you need to talk to your host about getting the globals set. There's a security feature in the newer versions of php that really messed me up and I had plenty of problems getting things working again. (see link above about php 4.2+) But your errors are a little deeper since $_SERVER isn't working either.

    If you did the upgrade, then you might want to try removing it, going back to the earlier php version and then doing some testing on php 4.3.1 on a local machine with a back-up copy of the board.
    <abbey />
    HTML/XHTML/CSS coding
    Abbey Ink

  12. #12
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    nb canada
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    register_globals are off ...humm

    and i never upgraded. .. fresh install and it was just how ever it set its self up. . i run ipb forums just fine no problem .. tagbaord and this online box script dont work. .

    i could give an ftp account with some space if someone wants to try a script or evne over the full computer if you want to check my php files. . cause honestly im just about lost . . missing in action or something .. i dont understand this stuff


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
  •