html - PHP $_POST not working? -
html - PHP $_POST not working? -
this question has reply here:
php post not working 6 answersi have simplest form possible , want echo whatever written in text box.
html:
<form action="" method="post"> <input type="text" name="firstname"> <input type="submit" name="submit" value="submit"> </form>
php:
if(isset($_post['submit'])){ $test = $_post['firstname']; echo $test; }
the problem it's not working on server (it works on server). has thought wrong? there other forms on server , working fine.
a few thing do:
make sure "action" attribute on form leads right destination. try using $_request[] instead of $_post, see if there change.[optional] seek including both 'name' , 'id' attribute e.g.
<input type="text" name="firstname" id="firstname">
if in linux environment, check have both read/write permissions file.
in addition, link might help.
edit:
you substitute if(isset($_post['submit'])){
this: if($_server['request_method'] == "post"){
. best way of checking whether or not form has been submitted
php html forms post
Comments
Post a Comment