1 submitting by hiding a form
//submit The If ($_post[' action ' = = ' Register ') by hiding the form {echo ' you submitted the data '; Exit (); }?><!DOCTYPE HTML><Head></Head><Body> <DivID= ' Register '> <formMethod= "post"name= "register"Action= "register.php"> <inputtype= "hidden"name= "action"value= "register" /> <ul> <H2>Please fill in the content carefully</H2> <Li>With & #8194户 & #8194名:<inputtype= ' text 'name= ' username 'class= ' text '/>(* required, at least two People)</Li> <Li>Secret & #12288 & #12288码:<inputtype= ' Password 'name= ' Password 'class= ' text '/>(* required, at least two People)</Li> <Li><inputtype= ' Submit 'value= ' Submit '/></Li> </ul> </form> </Div></Body>
2 Submit data after passing the suffix
<?PHP if ($_get[' action '] = = ' Register ') {echo ' you submitted data '; Exit (); }?><!DOCTYPE HTML><Head></Head><Body> <DivID= ' Register '> <formMethod= "post"name= "register"Action= "register.php?action=register"> <ul> <H2>Please fill in the content carefully</H2> <Li>With & #8194户 & #8194名:<inputtype= ' text 'name= ' username 'class= ' text '/>(* required, at least two People)</Li> <Li>Secret & #12288 & #12288码:<inputtype= ' Password 'name= ' Password 'class= ' text '/>(* required, at least two People)</Li> <Li><inputtype= ' Submit 'value= ' Submit '/></Li> </ul> </form> </Div></Body>
Two forms of form data submission in PHP