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">
- <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");
- require_once DEDEINC."/arc.partview.class.php";
- $pv = new PartView();
- $pv->SetTemplet(DEDETEMPLATE."/plus/baoming.htm");
- $pv->Display();
- ?>
在做一个baominged.php的文件:
- <?php
- require_once (dirname(__FILE__) . "/../include/common.inc.php");
-
-
-
-
-
- emptyempty($dopost)? "" : $dopost;
- if($dopost == "save"){
-
-
- $sql="INSERT INTO `dede_ming` (`username`,password,email )VALUES (
- '".$username."','".$password."','".$email."')";
- $dsql->ExecuteNoneQuery($sql);
- ShowMsg("成功增加一条记录内容!","baoming.php");
- exit();
- }
- ?>
这样就可以往数据库内添加东西了,希望帮助大家.