Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Php $_post Empty In Iis 6?

    Hi,

    I installed PHP on IIS 6.0 - Everything was working fine until I tried to submit a form. The PHP $_POST super global is always empty.

    I've checked to ensure that my form has method="post", and I don't think it's a coding error, since the same exact script is working fine on my other machine.

    Does anyone know why this might be? Appreciate your expertise.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Can you post your code including the form?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts
    Suggestion: Although you think it is not a coding error, you should post your script anyway. Makes it much easier for people to reply and help!

    EDIT: What Aero said!

  • #4
    New Coder
    Join Date
    May 2006
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Form Page:
    Code:
    <form action="process.php" method="post">
    
    <b>Name:</b><br />
    <input type="text" name="name"><br /><br />
    
    <b>Email:</b><br />
    <input type="text" name="email"><br /><br />
    
    <input type="submit" value="Submit">
    
    </form>
    Form Process Page:

    Code:
    <?php
    
    print_r($_POST);
    
    echo $_POST['name'];
    
    echo $_POST['email'];
    
    ?>
    The PHP page doesn't display any $_POST data. It only displays:

    Array ( )

    If I use $_GET instead of $_POST it works fine, and the same code works fine on my other development machine. Which leads me to believe it is a server/configuration issue? Any suggestions?
    Last edited by centenial; 08-21-2007 at 02:23 AM.

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,036
    Thanks
    2
    Thanked 316 Times in 308 Posts
    Edit: ^^^^^ what they said...

    You would need to post your code to get specific help. 99% of the problems of code working on one PHP system and not another are due to php configuration differences. The other 1% are due to PHP version or web server differences. If you post your code, someone might spot something it is doing that could be causing the problem.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,036
    Thanks
    2
    Thanked 316 Times in 308 Posts
    The only thing that comes to mind is if the post_max_size parameter is zero. I suspect that php cannot find any php.ini file to use.

    Create a phpinfo.php file with the following code in it and browse to it -
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    Near the top of the resultant output are two lines related to the path for php.ini and the actual php.ini file that is getting used. What do they say? Also, search/scroll to find the post_max_size value. What is it?

    Oh, and telling all the symptoms, such as it working using $_GET, is important from the get go.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #7
    New Coder
    Join Date
    May 2006
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The configuration file it's using is C:/WINDOWS/php.ini

    POST_MAX_SIZE is set to 32MB

    Is there a specific ini setting that turns super globals off? I didn't think so, but that's what this appears to be... or something similiar...

    Do I need to enable something from within IIS to allow for POST submissions?


  •  

    Posting Permissions

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