Yet another $_POST Problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
PHP version 5.1.1
Apache 2.0.55.


<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
<form action="foo.php" method="post" name="form">
        <input name='username' type="text" value="colin">
        <input name="submit" type="submit" value="submit me!">


        echo "We are on foo.php";
        echo "<br>";
        $username = isset($_POST['username']) ? $_POST['username'] :
        $email = isset($_POST['email']) ? $_POST['email'] : NULL;
        echo $username;
        echo $email;

We are on foo.php

So simple.  So easy.  Yet $username and $email will not get printed.

All my forms worked perfectly last week (boo-hoo, I know), but now only
GET will work on even the simplest of forms.  And I would rather not go
through every form and change them to get.

Cause it's past midnight on my second day of trying to fix this I have
to ask.......
Any ideas?
Did I change a php.ini setting in my sleep?

/* It can take hours to find the problem and a second to fix it. */

Re: Yet another $_POST Problem

Try a


and see what you get.  If nothing, then NULLs will be assigned as per  
your code.  This also probably points to a php.ini or other PHP or  
Apache setting that is preventing POST variables, because AFAICT, you  
code appears to be correct.

Re: Yet another $_POST Problem

cheers Mark.

I have tried that allright.  For GET it populates the Array but for
POST the array is empty.
Once I got all my text forms working correctly I moved onto file
upload.  The only thing I can remember changing is the maximum file
size allowed in php.ini.  But the fact that it worked and now doesn't
means I changed something else.  But I can't for the life of me figure
out what it is.  Anything specific I should look for?  php.ini and
apache config looks fine.  But I could be looking through rose tinted

Thanks again mate.

Re: Yet another $_POST Problem

Well, I answered my own question.
By changing
post_max_size = 1000000000M to
post_max_size = 100000000M
all post data was sent.

The reason I changed it was that I thought it worked in conjunction

but this doesn't seem to be the case.  File upload will still upload
files of a gig.


Thanks Mark.

Re: Yet another $_POST Problem

Quoted text here. Click to load it

Don't you think that 100,000 GIGABYTES is a little excessive for
POST data?  Besides, it's apparently taking it as a signed 32-bit
number anyway, and if it's negative, it won't allow any.

                    Gordon L. Burditt

Re: Yet another $_POST Problem

Quoted text here. Click to load it

isset is not the function you want to use.  Try empty().

Stan McCann "Uncle Pirate"
Webmaster/Computer Center Manager, NMSU at Alamogordo There are 10 kinds of people.
Those that understand binary and those that don't.

Site Timeline