PHP和MySql中的新闻项目

此项目是PHP和MySql中的新闻项目;同时分为两个模块:用户模块和管理模块。从下面几点告诉我们如何运行NewsPortal Project:1.下载压缩文件。2.解压缩文件并复制newsportal文件夹。3.粘贴到根目录中。4.打开phpmyadmin。5.创建一个名称为newsportal的数据库。6.导入newsportal.sql文件。7,运行脚本。8.对于管理面板http:// localhost / newsportal / admin。本人只展示了一小段的代码,如想了解更详细请下载附件。

应用介绍

此项目是PHP和MySql中的新闻项目;同时分为两个模块:用户模块和管理模块。用户模块是任何人都可以阅读新闻,也可以搜索特定新闻; 读者可以对特定新闻发表评论。管理模块有:安全的管理员登录系统、管理控制台、类别–在此部分中,管理员可以添加/更新/删除类别; 管理员还可以恢复已删除的类别、子类别–在此部分中,管理员可以添加/更新/删除子类别; 管理员还可以还原已删除的子类别、发布-管理员可以添加/更新/删除新闻发布, 管理员还可以在“垃圾邮件”部分中查看已删除的新闻帖子,并还原已删除的帖子、页面–管理员可以管理关于我们的联系人并与我们联系页面、评论–管理员可以批准/取消/删除读者评论。从下面几点告诉我们如何运行NewsPortal Project:1.下载压缩文件。2.解压缩文件并复制newsportal文件夹。3.粘贴到根目录中(对于xampp xam / htdocs,对于wamp wamp / www,对于灯var / www / html)。4.打开phpmyadmin(http:// localhost / phpmyadmin)。5.创建一个名称为newsportal的数据库。6.导入newsportal.sql文件(在sql文件夹的zip包内提供)。7,运行脚本http:// localhost / newsportal(前端)。8.对于管理面板http:// localhost / newsportal / admin。本人只展示了一小段的代码,如想了解更详细请下载附件。

<?php
session_start();
include('includes/config.php');
error_reporting(0);
if(strlen($_SESSION['login'])==0)
  { 
header('location:index.php');
}
else{
if(isset($_POST['submit']))
{
$category=$_POST['category'];
$description=$_POST['description'];
$status=1;
$query=mysqli_query($con,"insert into tblcategory(CategoryName,Description,Is_Active) values('$category','$description','$status')");
if($query)
{
$msg="Category created ";
}
else{
$error="Something went wrong . Please try again.";    
} 
}

?>

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Newsportal | Add Category</title>
        <!-- App css -->
        <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/core.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/components.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/icons.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/pages.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/menu.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/responsive.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="../plugins/switchery/switchery.min.css">
        <script src="assets/js/modernizr.min.js"></script>
    </head>

    <body class="fixed-left">
        <!-- Begin page -->
        <div id="wrapper">
<!-- Top Bar Start -->
 <?php include('includes/topheader.php');?>
<!-- Top Bar End -->

<!-- ========== Left Sidebar Start ========== -->
           <?php include('includes/leftsidebar.php');?>
 <!-- Left Sidebar End -->
            <div class="content-page">
                <!-- Start content -->
                <div class="content">
                    <div class="container">

                        <div class="row">
       <div class="col-xs-12">
        <div class="page-title-box">
                                    <h4 class="page-title">Add Category</h4>
                                    <ol class="breadcrumb p-0 m-0">
                                        <li>
                                            <a href="#">Admin</a>
                                        </li>
                                        <li>
                                            <a href="#">Category </a>
                                        </li>
                                        <li class="active">
                                            Add Category
                                        </li>
                                    </ol>
                                    <div class="clearfix"></div>
                                </div>
       </div>
      </div>
                        <!-- end row -->

                        <div class="row">
                            <div class="col-sm-12">
                                <div class="card-box">
                                    <h4 class="m-t-0 header-title"><b>Add Category </b></h4>
                                    <hr />
                          

<div class="row">
<div class="col-sm-6">  
<!---Success Message--->  
<?php if($msg){ ?>
<div class="alert alert-success" role="alert">
<strong>Well done!</strong> <?php echo htmlentities($msg);?>
</div>
<?php } ?>
<!---Error Message--->
<?php if($error){ ?>
<div class="alert alert-danger" role="alert">
<strong>Oh snap!</strong> <?php echo htmlentities($error);?></div>
<?php } ?>

</div>
</div>


                           <div class="row">
                            <div class="col-md-6">
                             <form class="form-horizontal" name="category" method="post">
                                             <div class="form-group">
                                                 <label class="col-md-2 control-label">Category</label>
                                                 <div class="col-md-10">
                                                     <input type="text" class="form-control" value="" name="category" required>
                                                 </div>
                                             </div>
                                      
                                             <div class="form-group">
                                                 <label class="col-md-2 control-label">Category Description</label>
                                                 <div class="col-md-10">
                                                     <textarea class="form-control" rows="5" name="description" required></textarea>
                                                 </div>
                                             </div>
        <div class="form-group">
                                                    <label class="col-md-2 control-label">&nbsp;</label>
                                                    <div class="col-md-10">
                                                  
                                                <button type="submit" class="btn btn-custom waves-effect waves-light btn-md" name="submit">
                                                    Submit
                                                </button>
                                                    </div>
                                                </div>
                                         </form>
                            </div>

                           </div>

                           


           
                       

                                </div>
                            </div>
                        </div>
                        <!-- end row -->

                    </div> <!-- container -->
                </div> <!-- content -->
<?php include('includes/footer.php');?>
            </div>
        </div>
        <script>
            var resizefunc = [];
        </script>
        <!-- jQuery  -->
        <script src="assets/js/jquery.min.js"></script>
        <script src="assets/js/bootstrap.min.js"></script>
        <script src="assets/js/detect.js"></script>
        <script src="assets/js/fastclick.js"></script>
        <script src="assets/js/jquery.blockUI.js"></script>
        <script src="assets/js/waves.js"></script>
        <script src="assets/js/jquery.slimscroll.js"></script>
        <script src="assets/js/jquery.scrollTo.min.js"></script>
        <script src="../plugins/switchery/switchery.min.js"></script>
        <!-- App js -->
        <script src="assets/js/jquery.core.js"></script>
        <script src="assets/js/jquery.app.js"></script>
    </body>
</html>
<?php } ?>

文件列表(部分)

名称 大小 修改日期
Newsportal Project0.00 KB2018-12-44
newsportal0.00 KB2018-12-00
about-us.php1.65 KB2018-07-48
about.html8.35 KB2018-07-28
admin0.00 KB2018-12-50
aboutus.php8.08 KB2018-06-58
add-category.php6.67 KB2018-06-16
add-post.php10.03 KB2018-08-10
add-subcategory.php7.79 KB2018-06-36
assets0.00 KB2018-12-48
css0.00 KB2018-12-44
bootstrap.min.css118.36 KB2016-07-28
bootstrap.min.css.map529.49 KB2016-07-28
components.css82.76 KB2018-04-00
core.css16.92 KB2016-09-48
elements.css0.00 KB2016-09-48
icons.css197.33 KB2016-09-50
menu.css11.54 KB2016-10-48
menu_sm.css10.58 KB2018-04-44
pages.css19.00 KB2018-04-58
responsive.css4.14 KB2016-09-48
typicons.css22.10 KB2016-09-48
variables.css0.00 KB2016-09-48
fonts0.00 KB2018-12-46
fontawesome-webfont.eot74.72 KB2016-07-46
fontawesome-webfont.svg382.44 KB2016-07-46
fontawesome-webfont.ttf149.21 KB2016-07-46
fontawesome-webfont.woff88.29 KB2016-07-46
fontawesome-webfont.woff270.21 KB2016-07-46
FontAwesome.otf122.06 KB2016-07-46
glyphicons-halflings-regular.eot19.66 KB2016-07-02
glyphicons-halflings-regular.svg106.19 KB2016-07-02

立即下载

相关下载

[PHP和MySql中的新闻项目] 此项目是PHP和MySql中的新闻项目;同时分为两个模块:用户模块和管理模块。从下面几点告诉我们如何运行NewsPortal Project:1.下载压缩文件。2.解压缩文件并复制newsportal文件夹。3.粘贴到根目录中。4.打开phpmyadmin。5.创建一个名称为newsportal的数据库。6.导入newsportal.sql文件。7,运行脚本。8.对于管理面板http:// localhost / newsportal / admin。本人只展示了一小段的代码,如想了解更详细请下载附件。

评论列表 共有 0 条评论

暂无评论

微信捐赠

微信扫一扫体验

立即
上传
发表
评论
返回
顶部