<?php echo $_POST['ss'];?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> <input name="ss" type="text" /> <input type="submit" name="submit"> </form>
This code should print whatever is enter in text box name="ss" when click submit.
But its not printing. Working with method="get" but not with post, What's the problem.
If you're just refreshing the page, do:
Also, add this to line 2 to see what's being stored (if anything) in the $_POST array:
Hmm... so it's empty on submit? Try adding this to the top of your php file:
Okay, now check your php.ini (normally requires sudo or root in /etc):
Do you have those two rules set? If so, be careful of how much memory you're allocating. Anything over 2048MB could start to give you trouble, depending on your system specs.
NOTE: If you make changes to your php.ini file and PHP is running as an apache module, you'll need to restart apache. Something along the lines of: