Jump to content

a doubt on $_POST['SUBMIT']...


Recommended Posts

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...

Link to comment
Share on other sites

<?
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....  
}

}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.