制作网页 如何加上留言板?10点!!!!十万火急!!!!!两日后一定要完成网页!!

制作网页 如何加上留言板?10点!!!!十万火急!!!!!两日后一定要完成网页!!,第1张

制作访客留言 signin 可以使用网页编辑器来快速制作,也可以手动用 HTML 语法来撰写。 以下是 signin 的内容: <> <head> <!-- 加上以下这一行,以免有乱码产生 --> <meta -equiv="Content-Type" content="text/charset=big5"> <title>留言板</title> </head> <body bgcolor="white"> <hr size=1> <center> <!--以下是您的站台名称--> <font size=5 color=red>我的访客留言板</font> <br> <!--以下是您的版权宣告--> <font color="green" size="2"> v1.0 精简版 (C) 1997 written by OLS3</font> <hr size=1> <table align=center border=0><tr><td> <!--以下是表单内容

共有二个栏位: 姓名及留言内容

您可以自行再增添表单采 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”,页面内容里面随便输入你想要给留言者看的内容就行了。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11600059.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-17
下一篇 2023-05-17

发表评论

登录后才能评论

评论列表(0条)

保存