PHP $_POST
<!DOCTYPE html> <html> <body> <form method="post" action="<?php echo $_SERVER[‘PHP_SELF‘];?>
"> Name: <input type="text" name="fname"> <input type="submit"> </form><?php $name = $_REQUEST[‘fname‘]; echo $name; ?>
</body> </html>
PHP $_GET
<html> <body> <a href="test_get.php?subject=PHP&web=W3school.com.cn">测试 $GET</a> </body> </html>
<html> <body> <?php echo "Study " . $_GET[‘subject‘] . " at " . $_GET[‘web‘]; ?> </body> </html>
时间: 2024-10-14 10:55:10