在dedecms默认模版内templets内plus内做一个报名的文件文件名是baoming.htm,代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="baominged.php">
<table width="400" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#6699FF">
<tr>
<td bgcolor="#FFFFFF">用户名:</td>
<td bgcolor="#FFFFFF"><input type="hidden" name="dopost" value="save"><input name="username" type="text" id="username" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">密码:</td>
<td bgcolor="#FFFFFF"><input name="password" type="text" id="password" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">EMAIL:</td>
<td bgcolor="#FFFFFF"><input name="email" type="text" id="email" /></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" name="Submit" value="提交" />
<input type="reset" name="Submit2" value="重置" /></td>
</tr>
</table>
</form>
</body>
</html>
在puls插件内做一个baoming.php的文件:
<?php
require_once (dirname(__FILE__) . "/../include/common.inc.php");
//——————-
//| 表单处理过程 |
//| Save() |
//——————-
// ↓
emptyempty($dopost)? "" : $dopost;
if($dopost == "save"){
//如果执行插入操作
// $sql = "INSERT INTO `dede_test` (`username`) VALUES ('".$name."')";
$sql="INSERT INTO `dede_ming` (`username`,password,email )VALUES (
'".$username."','".$password."','".$email."')";
$dsql->ExecuteNoneQuery($sql); //执行这个插入语句
ShowMsg("成功增加一条记录内容!","baoming.php");
exit(); //开源软件:Cuoxin.com
}
?>
dedecms二次开发_在线报名程序(一)
在dedecms默认模版内templets内plus内做一个报名的文件文件名是baoming.htm,代码如下: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml h
本文来自网络,不代表站长网立场,转载请注明出处:https://www.tzzz.com.cn/html/jianzhan/jy/2021/1214/38205.html