Lu Junxiang's Blog

岁月在人的心里留下痕迹~

原创 经典的PHP&Form入门例子收藏

新一篇: 应用需要数据库支持,而且很重要! | 旧一篇: Java学习之路

这是一个经典的PHP&Form入门例子,相信每个PHPer都很熟悉,回头想想,学习PHP就是这么一步一步走过来的:
hello.html:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>An Example of PHP & Form</title>
</head>
<body>
<h1>An Example of PHP & Form</h1>
<br/>
<form action='./response.php' method='post'>
  <table>
  <tr>
    <td>User Name : </td>
    <td><input type='text' name='username' size='20'/></td>
  </tr>
  <tr>
    <td></td>
    <td align=right>
    <input type='submit' value='Submit'/>
    </td>
  </tr>
  </table>
</form>
</body>
</html>

------

response.php:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>An Example of PHP & Form</title>
</head>
<body>
<h1>An Example of PHP & Form</h1>
<br/>
<?php
  $userName = $_POST['username'];
  echo "Welcome,{$userName}!<br/>";
?>
</body>
</html>
 

发表于 @ 2007年02月07日 08:46:00|评论(loading...)|编辑

新一篇: 应用需要数据库支持,而且很重要! | 旧一篇: Java学习之路

评论:没有评论。

发表评论  


当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
Csdn Blog version 3.1a
Copyright © lujunxiang