input.html 源代码 <html> <head> <!--set title--> <title> Input Form </title> </head> <!--show page--> <body> <form action = "input.php" method = "POST" autocomplete = "on"> Name: <input type = "text" name = "name"> <br> Age: <input type = "text" name = "age"> <br> Address: <input type = "text" name = "addr"> <br> Sex: male<input type = "radio" name = "sex" value = "male"> female<input type = "radio" name = "sex" value = "female"> <br> <input type = "submit" value = "input"> </form> </body> </html> input.php源代码 <html> <head> <!--set title--> <title> input information </title> </head> <!--show page--> <body> <?php function GetParamString(&$str) { $strTemp = $str; if (ini_get('magic_quotes_gpc')) { $str = stripslashes($strTemp); } return $str; } ?> <?php $strName = $_POST['name']; $nAge = $_POST['age']; $strAddr = $_POST['addr']; $bSex = $_POST['sex']; GetParamString($strName); GetParamString($nAge); GetParamString($strAddr); GetParamString($bSex); echo "========== input information ========= <br>/n"; echo "name = $strName <br>/n"; echo "age = $nAge <br>/n"; echo "address = $strAddr <br>/n"; echo "sex = $bSex <br>/n"; ?> </body> </html>