
比如你用jsp的话,
a.jsp中
...
b.jsp:
<%
String
name
=
request.getParameter("name")
//
这里可以连接数据库
PersonDao
pd
=
new
PersonDaoImpl()
Person
p
=
pd.query(name)
out.println("你提交的名字是:"
+
name
+
",查询结果:"
+
p)
%>
1:首先要使用PHP的超全局变量 $_GET 和 $_POST 用于收集表单数据(form-data)2:然后使用INSERT INTO 语句用于向数据库表中插入新记录。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)