How to use PHP or javascript to achieve the following functions: Submit the data entered in form1 in 1.html (php) to another web page 2.html (php ) or txt text,
Solution:
Create go.php, the code is as follows
<?php @$username = $_POST['name']; @$usermessage = $_POST['message']; if(!empty($username) || !empty($usermessage)){ echo "您的姓名:".$username.",您的留言内容:".$usermessage; } else{ echo '<form action="go.php" method="post"> 您的姓名:<input type="text" name="name"> <br><br> 留言内容:<input type="text" name="message"> button>提交</button></form>'; } ?>
Case screenshot:
The above is the detailed content of How to implement form submission using PHP?. For more information, please follow other related articles on the PHP Chinese website!