文章标题

文章标题_第1张图片


session_start();
$type = 4;
?>

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>内容页title>
        <link href="css/comm.css" rel="stylesheet" type="text/css" />
        <link href="css/content.css" rel="stylesheet" type="text/css" />
        <link href="css/content_nav.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="myform.js">script>
    head>
    <body>
        <div id="box">
            
            include_once 'top.php';
            ?>
            <div id="top_bg">div>
            <div id="content">
                <div id="content_nav">
                    <ul>
                        <li class="spa_a"><a href="#">子栏目一a>li>
                        <li><a href="#">子栏目二a>li>
                        <li><a href="#">子栏目三a>li>
                        <li><a href="#">子栏目四a>li>
                        <li><a href="#">子栏目五a>li>
                        <li><a href="#">子栏目六a>li>
                    ul>
                div>
                <div id="position_nav">
                    <strong>当前位置:strong>首页<span>>span>栏目页<span>>span>内容页
                    <img src="Library/images/Wap.gif"/>
                    <img src="Library/images/Rss.gif"/>
                div>
                <div id="main">
                    
                    include_once 'main_left.php';
                    ?>
                    <div id="main_right">
                        
                        if (isset($_GET["aid"])) {
                            $aid = $_GET["aid"];
                        } else {
                            $aid = 1;
                        }
                        $sql = "select * from articles join user on articles.uid=user.id where articles.id={$aid}";
                        $row = sqlSelect1($sql);
                        ?>
                        <h5> echo $row["title"]; ?>h5>
                        <div id="main_right_top">
                            <h2> echo $row["title"]; ?>h2>
                            <span>作者: echo $row["nicheng"]; ?> 来源:www.xinwenwang.com 更新时间: echo $row["add_time"]; ?><br />span>
                        div>
                        <div id="main_right_middle">
                             echo $row["content"]; ?><br />
                            
                            $myimgs = explode(",", $row["content_imgs"]);
                            foreach ($myimgs as $myimg) {
                                echo "
. "width='300' height='150>'

"
; } ?>
<br /> div>
<div id="main_right_bottom"> <ul> $sql1 = "select min(id) as minid,max(id) as maxid from articles"; $row1 = sqlSelect1($sql1); if ($aid <= ($row1["minid"])) { ?> <li>上一篇:没有了li> } else { $sql = "select * from articles where id=(select max(id) from articles where id<{$aid})"; //这里利用一个嵌套的子查询 查出比当前id稍小的id数 $row11 = sqlSelect1($sql); ?> <li>上一篇:<a href="content.php?aid=id"]; ?>"> echo $row11["title"]; ?>a>li> } ?> $sql1 = "select min(id) as minid,max(id) as maxid from articles"; $row1 = sqlSelect1($sql1); if ($aid >= $row1["maxid"]) { ?> <li>下一篇:没有了li> } else { $sql = "select * from articles where id=(select min(id) from articles where id>{$aid})"; //这里利用一个嵌套的子查询 查出比当前id稍大的id数 $row11 = sqlSelect1($sql); ?> <li>下一篇:<a href="content.php?aid=id"]; ?>"> echo $row11["title"]; ?>a>li> } ?> ul> div> <div id="main_right_bottom2"> <ul> <li><a href="comment.php">发表评论a>li> <li><a href="#" onclick="window.close();">关闭窗口a>
li>
<li><a href="#top">返回顶部a>
li>
ul> div> if (isset($_SESSION["username"])) { ?> <div id="content_bottom"> <form action="public.php" method="post"> <textarea id="message" name="message" onclick="textClear()">请发表评论 textarea><br>br> <input type="hidden" name="aid" value=""> <input type="submit" name="sbt" id="sbt" value="发表"> form> div> } ?> //print_r($_SERVER); 系统数据 ?> <h5>网友评论h5> <ul> $sql = "select * from comment join user on comment.user_id=user.id" . " where comment.article_id={$aid} order by comment_time desc"; $rows3 = sqlSelect($sql); foreach ($rows3 as $row3) { $mydate = explode(" ", $row3["comment_time"]); ?> <li>[ echo $mydate[0]; ?>] echo $row3["username"]; ?> echo $row3["comm_content"]; ?>li> } ?> ul> div> div> div> include_once 'bottom.php'; ?> div> body> html>

你可能感兴趣的:(php,html)