getRequestInfo.php
<html>
<body>
<form action="scripts/showRequestInfo.php" method="post">
<fieldset>
<label for="first_name">First Name:</label>
<input type="text" name="first_name" size="20" /><br />
<label for="last_name">Last Name:</label>
<input type="text" name="last_name" size="20" /><br />
<label for="email">E_Mail Address:</label>
<input type="text" name="email" size="20" /><br />
<label for="facebook_url">Facebook URL:</label>
<input type="text" name="facebook_url" size="20" /><br />
<label for="twitter_handle">Twitter Handle:</label>
<input type="text" name="twitter_handle" size="20" /><br />
</fieldset>
<br />
<fieldset class="center">
<input type="submit" value="Join the Club" />
<input type="reset" value="Clear and Restart" />
</fieldset>
</form>
</body>
</html>
在scripts目录下的showRequestInfo.php
<HTML>
<BODY>
<div id="content">
<?php
foreach($_REQUEST as $value){
echo "<p>". $value ."</p>";
}
?>
</div>
</BODY>
</HTML>
也可以用这种形式:
<?php
foreach($_REQUEST as $key => $value){
echo "<p>For" . $key . ", the value is " . $value ."</p>";
}
?>