源代码:
<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; ?>
运行结果:
<form method="post" action="/index.php/online/php/demo_global_post"> Name: <input type="text" name="fname"> <input type="submit"> </form>