一,Insert.htm源码: <html> <body> 二,Insert.php源码: <html> <body> 所用到的SQL语句:insert into score (Number,Name,Chinese,English,Math) values ($Number,'$Name',$Chinese,$English,$Math)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Insert</title>
</head>
<p>Score资料表--新增资料录
</p>
<p><hr noshade></p>
<form name="form1" method="post" action="insert.htm">
<table width="200" border="0" align="center">
<tr>
<td>Number</td>
<td><input type="text" name="Number"></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="Name"></td>
</tr>
<tr>
<td>Chinese</td>
<td><input type="text" name="Chinese"></td>
</tr>
<tr>
<td>English</td>
<td><input type="text" name="English"></td>
</tr>
<tr>
<td>Math</td>
<td><input type="text" name="Math"></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="提交"></td>
<td> </td>
</tr>
</table>
</form>
<hr noshade>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>insert</title>
</head>
<?php
mysql_connect("ftp","root","");
mysql_select_db("test");
$sql="insert into score (Number,Name,Chinese,English,Math) values ($Number,'$Name',$Chinese,$English,$Math)";
mysql_query($sql);
?> 新增一笔资料成功,<a href="insert.htm">请反回</a>!
</body>
</html>
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073