Data from the form submission where have you gone do?

Data from the form submission where have you gone do?


From a simple case are as follows:

<form>
    姓名:<br>
    <input type="text" name="firstname">//用来输入内容的一个文本框
    <br>
    <input type="submit" name="Submit" value="登录" >//一个提交按钮
</form> 

How to make the data submitted to the success of it back?

<form action="处理提交数据的.php">

Submit to whom, action which is, who, method which way to fill in data transmission, there are many ways to transfer data, which is widely used get and post method. The main difference is that post and get get is visible post is not visible.

php code we use print_r ($ _ POST) to see what post pass over that?

The answer is an array

Sample code above effects are as follows:

<form method="post"  action="index.php">//就把数据交给index.php本身来处理也是可以的
    姓名:<br>
    <input type="text" name="firstname">//用来输入内容的一个文本框
    <br>
    <input type="submit" name="Submit" value="登录" >//一个提交按钮
</form> 

<?php 
    print_r($_POST);
  
?>

We get into it? Careful you will find the address bar appeared in our data submitted. So if the password is to use post.

How to pass over the data processing.

 $hello=$_POST["firstname"];//当变量用就完了

Only to recall the article notes, the contents of the comparison in passing, to form from a deeper understanding of themselves w3school or Baidu, will not be the same as for html.

Guess you like

Origin www.cnblogs.com/chenguosong/p/11832524.html