表单
- <!--{eval $note_message=DB::result_first("select message from ".DB::table("cmsbj_note")." where `id`='$_GET[id]'");}-->
- <!--{if $_GET['action']=='edit'}--> <form action="bdpost.php?action=edit&id=$_GET['id']" method="post" autocomplete="off"> <!--{else}--> <form action="bdpost.php" method="post" autocomplete="off"> <!--{/if}-->
- <input type="hidden" value="{FORMHASH}" name="formhash" />
- <div class="f_body fs_body">
- <!--{subtemplate home/editor_image_menu}-->
- <!--{eval require_once libfile('function/upload');$swfconfig = getuploadconfig($_G['uid'], 0, true);require_once libfile('function/spacecp');$albums = getalbums($_G['uid']);}-->
- <textarea class="userData" name="message" id="uchome-ttHtmlEditor" style="height: 100%; width: 100%; display: none; border: 0px">{if $_GET['action']=='edit'}{$note_message}{/if}</textarea>
- <iframe src='home.php?mod=editor&charset={CHARSET}&allowhtml=1&isportal=1' name='uchome-ifrHtmlEditor' id='uchome-ifrHtmlEditor' scrolling='no' style='width:85%;height:400px;border:1px solid #C5C5C5;position:relative;' border=0 frameborder=0 ></iframe>
- <iframe id="uploadframe" name="uploadframe" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>
- <input id='submit_editsubmit' class='btn' type='submit' value='提交' name='editsubmit' onClick='validate(this);'>
- <script type="text/javascript" src="static/image/editor/editor_function.js"></script>
- <script type="text/JavaScript">
- function validate(obj) {
- edit_save();
- window.onbeforeunload = null;
- obj.form.submit();
- return false;
- }
- </script>
- <div class="f_submit">
- <input type="hidden" name="test_submit" value="true" />
- </form>
- </div>
- </div>
复制代码 修改链接
- <a href="test.php?action=edit&id=$_GET['id']">修改</a>
复制代码 bdpost.php
- <?php
- require_once './source/class/class_core.php';
- $discuz = & discuz_core::instance();
- $discuz->cachelist = $cachelist;
- $discuz->init();
- if(submitcheck('test_submit')) {
- $setarr = array(
- 'message' => $_POST['message'],
- 'dateline' => strtotime(date("Y-m-d H:i:s")),
- 'uid' => $_G['uid'],
- );
- $id = $_GET['id'];
- if($id){
- DB::update('cmsbj_note', $setarr, "id='$id'");
- }else{
- DB::insert('cmsbj_note', $setarr, 1);
- }
- showmessage('恭喜提交成功', "test.php?id=$_GET[id]");
- }
- ?>
复制代码
|