blueeyes4ya Posted May 13, 2009 Share Posted May 13, 2009 i have a small query on usage of $_POST[' ']...i have a submit button..its just a registration form and after filling all fields, i check whether the button has been submitted and write all operations inside that...i will write a small example of what i did.. //all form in html here <?php if (isset($_POST['submit'])){ if(empty(.......cheking whether any field is empty...){ printing missing field } echo " helllo...."; } else{ // } ?> The problem is for the first time when i submit , hello will be displayed..next time if i load the page , hello will be display before i submit.Do i need to unset something here each time i load the page???Please help... Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted May 13, 2009 Share Posted May 13, 2009 No. Are you sure you are not just refreshing the page. This will resubmit the form. Quote Link to comment Share on other sites More sharing options...
Cosizzle Posted May 13, 2009 Share Posted May 13, 2009 Where is the form going after you hit submit? If you have it change location I doubt it will say hello Quote Link to comment Share on other sites More sharing options...
BK87 Posted May 17, 2009 Share Posted May 17, 2009 <? if($_POST["submit"]!=NULL){ if($_POST["username"]!=NULL&&$_POST["password"]!=NULL){ //username and/or password is filled }else{ //send person back to form or something.... } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.