共有二个栏位: 姓名及留言内容
您可以自行再增添表单采 POST 呼叫法
cgi 程式名称是 GBK.cgi --> <form name=ols3 method="post" action="主机/cgi-bin/GBK.cgi"> <!--姓名栏位的名称是 name--> 姓名: <input type=text name=name size="30"> <br> <!--留言内容栏位的名称是 ment--> 留言内容:<br> <textarea name=ment rows="5" cols="45"></textarea> <p> <input type=submit value="确定"> <input type=reset value="清除"> <input type=button value="回上一页" onClick="history.back()"> </form> </td></tr></table></center> </body> </> *请将全形 <> “” 改回半形 字数限制,详情请浏览:linux.tnc.edu/techdoc/perl_intro/x1157 用FrontPage制作留言板教学: sxtu.edu/change/xyxs/jyjs/zhiyuan/jiaocheng/wy-08
免费申请留言板 .sytes/cgi-bin/gb/add_user.cgi 按申请留言板....写完资料就申请完成
评论类似留言功能,如果要做个专业的图片站,最好选择一款CMS系统搭建,后台管理方便,且对服务器压力小,专业的CMS系统都是成熟的产品,各方面都比较优秀!
一般CMS系统都自带评论功能,直接用div+css和相关的标签直接调用即可!
推荐:dedecms、帝国cms
首先我们用dreamweaver新建一个PHP空白页面,在此页面顶部设置你要建的留言板的名称,代码如下,红色部分就是留言板的名称,可以自己随意取,建议用英文吧,不要纯中文。 <?php/*Template Name: liuyanban*/?>打开你主题的目录,找到page.php页面,然后把里面的代码全部复制过来粘贴到我们第一步新建的留言板页面。
第一二步完成后代码如下: <?php/*Template Name: liuyanban*/?><?php get_header(); ?><?php if (have_posts()) : the_post(); update_post_caches($posts); ?><div id=“post-<?php the_ID(); ?>”><h2><?php the_title(); ?></h2><div><?php edit_post_link(__(‘Edit’, 'inove‘), '<span>’, '</span>‘); ?><?php if ($comments || comments_open()) : ?><span><a href=“#respond”><?php _e('Leave a comment’, 'inove‘); ?></a></span><span><a href=“#comments”><?php _e('Go to comments’, 'inove‘); ?></a></span><?php endif?><div></div></div><div><?php the_content(); ?><div></div></div></div><?php include('templates/comments.php’); ?><?php else : ?><div><?php _e(‘Sorry, no posts matched your criteria.’, 'inove‘); ?></div><div id=“comments”><?php comments_template(“,true); ?></div><?php endif?><?php get_footer(); ?>
在上面的代码里面加上评论调用函数 <?php comments_template(”,true); ?>
建立了页面不能忘记了美化啊,怎么弄呢?我们需要做的就是直接调用文章内容页评论的CSS样式。代码如下(此代码和single.php里面的一样,不知道的朋友直接去主题目录single.php里面找): <div id=“comments”><?php comments_template(“,true); ?></div>
最后得到的留言本代码如下,将此页面存为”liuyanban.php“: <?php/*Template Name: liuyanban*/?><?php get_header(); ?><?php if (have_posts()) : the_post(); update_post_caches($posts); ?><div id=”post-<?php the_ID(); ?>“><h2><?php the_title(); ?></h2><div><?php edit_post_link(__('Edit’, 'inove‘), '<span>’, '</span>‘); ?><?php if ($comments || comments_open()) : ?><span><a href=”#respond“><?php _e('Leave a comment’, 'inove‘); ?></a></span><span><a href=”#comments“><?php _e('Go to comments’, 'inove‘); ?></a></span><?php endif?><div></div></div><div><?php the_content(); ?><div></div></div></div><?php include('templates/comments.php’); ?><?php else : ?><div><?php _e(‘Sorry, no posts matched your criteria.’, 'inove‘); ?></div><div id=”comments“><?php comments_template(”,true); ?></div><?php endif?><?php get_footer(); ?>
最后到WordPress后台-页面-新建一个页面,命名“留言板”。给此页面选择模板“liuyanban”,页面内容里面随便输入你想要给留言者看的内容就行了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)