Use the $_POST super global variable to receive the form data, and then use echo to output it to the page.
The following is the code:
<!doctype html> <html> <head> <title>利用超级全局变量$_POST接收表单</title> <meta http-equiv="content-type" contnet="text/html" charset="utf-8"/> </head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"/> Name:<input type="text" name="fname"/> <input type="submit"/> </form> <?php $name= $_POST['fname']; echo $name; ?> </body> </html>
The output content uses the post method to submit the data, and then uses $_POST['fname']; to receive the data assignment Go to the global variable of $name,
and then use echo to output the $name; variable to get the final result, which is the content in the form. .............
The above example of PHP using the super global variable $_POST to receive form data This is all the content that the editor has shared with you. I hope it can give you a reference and I hope you will support the PHP Chinese website.
For more examples of PHP using the super global variable $_POST to receive form data, please pay attention to the PHP Chinese website for related articles!