维基天空

August 18, 2006

PHP表单name可以直接作为变量

Filed under: MyProcedure — admin @ 11:46 pm

form_class :

<form method="post" name="form01" action="./2.php">
<input type="text" name="username" value=”>
<input type="submit" value=’submit’ name="submit">

2.php :

<?
echo $username;
// 或者
echo $_POST[’username’];
//不过手册上说:"PHP 4.2.0 起默认值为 register_globals = off 不提倡使用/依赖此种方法"
?>

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress