SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Git-R-Done
    Join Date
    Nov 2001
    Posts
    1,194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why Does This Work On One Server and Not Another?

    I am using the script below to load a different page after a visitor submits a form. It is just a page to show them the results of their submission. It works fine on a server running 4.1.2 but not on another that is running 4.0.6. The 4.1.2 server is my development server and the other is my website's server.

    This is in the top of the page in the <? ?> tags:

    if ($action=="submission")

    This is inside of the body of my HTML code:

    PHP Code:
    <?
    if (!$_POST) {

    print 
    "blah blah blah";

    } else {

    print 
    "blah blah blah";

    }
    ?>
    Any help would be greatly aprpeciated.


    Thanks,

    John

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP 4.0.6 does not recognize the "$_POST" variable or its counterparts. They were introduced into PHP 4.1.0.
    Wayne Luke
    ------------


  3. #3
    Git-R-Done
    Join Date
    Nov 2001
    Posts
    1,194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AHHHHHHH I figured that was the problem. Can somebody tell me another way to do this that will work with 4.0.6? I spent forever getting that to work.


    John

  4. #4
    SitePoint Enthusiast holev's Avatar
    Join Date
    Jul 2001
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use HTTP_POST_VARS var instead..

    (http://www.php.net/manual/en/languag...predefined.php)

    btw, what do you need the "if" statement for? in both situations you get "blah blah blah"
    holev

  5. #5
    Git-R-Done
    Join Date
    Nov 2001
    Posts
    1,194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    holev,

    Thanks for the info! It worked! Thank God it was that simple of a fix.

    >>btw, what do you need the "if" statement for? in both situations you get "blah blah blah"

    LOL


    John

  6. #6
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you put the following code before you access any get/post variables you can always use $_GET and $_POST:
    PHP Code:
    if ( !isset ( $_GET ) ) { $_GET $HTTP_GET_VARS; }
    if ( !isset ( 
    $_POST ) ) { $_GET $HTTP_POST_VARS; } 
    If you need the other $_* arrays you can add them too

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  7. #7
    SitePoint Evangelist ucahg's Avatar
    Join Date
    Apr 2001
    Location
    Sarnia, Ontario, Canada
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only downside to that is they're not global everywhere.

  8. #8
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    True, but do you need them to be? I normally just assign them to a variable and pass that to functions anyway

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •