2015-10-23 4 views
-3

Я создал форму для входа. После успешного входа в систему пользователь может видеть данные на странице listenquiries.php. Однако я не могу отобразить свою страницу. На момент подачи, я получаю следующее сообщение об ошибке:Ошибка анализа парсов PHP при отправке страницы

Parse error: parse error in C:\wamp\www\sungare\SungareAdmin\listenquiries.php on line 216

<?php 
include('session.php'); 
?> 
<!DOCTYPE html> 
<html lang="en"> 
<head> 

    <meta charset="utf-8"> 
    <title>Admin Panel</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template."> 
    <meta name="author" content="Neema & Namu"> 

    <!-- The styles --> 
    <link id="bs-css" href="css/bootstrap-cerulean.min.css" rel="stylesheet"> 

    <link href="css/charisma-app.css" rel="stylesheet"> 
    <link href='bower_components/fullcalendar/dist/fullcalendar.css' rel='stylesheet'> 
    <link href='bower_components/fullcalendar/dist/fullcalendar.print.css' rel='stylesheet' media='print'> 
    <link href='bower_components/chosen/chosen.min.css' rel='stylesheet'> 
    <link href='bower_components/colorbox/example3/colorbox.css' rel='stylesheet'> 
    <link href='bower_components/responsive-tables/responsive-tables.css' rel='stylesheet'> 
    <link href='bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css' rel='stylesheet'> 
    <link href='css/jquery.noty.css' rel='stylesheet'> 
    <link href='css/noty_theme_default.css' rel='stylesheet'> 
    <link href='css/elfinder.min.css' rel='stylesheet'> 
    <link href='css/elfinder.theme.css' rel='stylesheet'> 
    <link href='css/jquery.iphone.toggle.css' rel='stylesheet'> 
    <link href='css/uploadify.css' rel='stylesheet'> 
    <link href='css/animate.min.css' rel='stylesheet'> 

    <!-- jQuery --> 
    <script src="bower_components/jquery/jquery.min.js"></script> 

    <!-- The HTML5 shim, for IE6-8 support of HTML5 elements --> 
    <!--[if lt IE 9]> 
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> 
    <![endif]--> 

    <!-- The fav icon --> 
    <link rel="shortcut icon" href="img/favicon.ico"> 

</head> 

<body> 
    <?php 
error_reporting(E_ALL ^E_NOTICE ^E_WARNING); 
include_once("header.php");?> 


     <noscript> 
      <div class="alert alert-block col-md-12"> 
       <h4 class="alert-heading">Warning!</h4> 

       <p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> 
        enabled to use this site.</p> 
      </div> 
     </noscript> 

     <div id="content" class="col-lg-10 col-sm-10"> 
      <!-- content starts --> 
       <div> 
     <ul class="breadcrumb"> 
      <li> 
       <a href="dashboard.php">Home</a> 
      </li> 
      <li> 
       <a href="#">Openings List</a> 
      </li> 
     </ul> 
    </div> 

    <div class="row"> 
    <div class="box col-md-12"> 
    <div class="box-inner"> 
    <div class="box-header well" data-original-title=""> 
     <h2><i class="glyphicon glyphicon-user"></i> List of Current Online Openings</h2> 

     <div class="box-icon"> 
      <a href="#" class="btn btn-setting btn-round btn-default"><i class="glyphicon glyphicon-cog"></i></a> 
      <a href="#" class="btn btn-minimize btn-round btn-default"><i 
        class="glyphicon glyphicon-chevron-up"></i></a> 
      <a href="#" class="btn btn-close btn-round btn-default"><i class="glyphicon glyphicon-remove"></i></a> 
     </div> 
    </div> 
    <div class="box-content"> 
    <div class="alert alert-info"> <a class="btn btn-danger btn-sm" href="addjobopening.php"> 
       <i class="glyphicon glyphicon-plus icon-white"></i> 
       Add Job Opening 
      </a><!--For help with such table please check <a href="http://datatables.net/" target="_blank">http://datatables.net/</a>--></div> 
    <table class="table table-striped table-bordered bootstrap-datatable datatable responsive"> 
    <thead> 
    <tr> 
     <th>Sr. No.</th> 
     <th>Job Title</th> 
     <th>Job Code</th> 
     <th>Opening Duration</th> 
     <th>Options</th> 
    </tr> 
    </thead> 
    <tbody> 
    <?php 
     $qct ="SELECT * FROM `jobopening` where `job_status`='1'"; 
     $result=mysql_query($qct); 
    $ctnrow=mysql_num_rows($result);       
    if($ctnrow >=1){ 
    $count=1;   
     while($qres=mysql_fetch_array($result)){   
       //print_r($qres); 
          ?>  
    <tr> 
     <td><?php echo "$count";?></td> 
     <td class="center"><?=$qres['job_title']; ?></td> 
     <td class="center"><?=$qres['job_code']; ?></td> 
     <td class="center"> 
     <?=$qres['job_postdate']; ?> - <?=$qres['job_enddate']; ?> 
     </td> 


      <td class="center"> 
       <a class="btn btn-info" href="editjobopening.php?id=<?=$qres['openingid'];?>"> 
       <i class="glyphicon glyphicon-edit icon-white"></i> 
       Edit 
      </a> 
      <?php if($qres['job_status']==1) 
      { 
      ?> 
      <a class="btn btn-danger" href="modify.php?opening_id=<?=$qres['openingid']?>&job_status=deact_job" onClick="return confirm('Are you sure to Close opening?')"> 
       <i class="glyphicon glyphicon-trash icon-white"></i> 
       Close 
      </a> 
      <? } ?> 
     </td> 
    </tr> 
     <? $count=$count+1;  
           } 

    } 
          ?> 

    </tbody> 
    </table> 
    </div> 
    </div> 
    </div> 
    <!--/span--> 

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


    </div><!--/#content.col-md-0--> 
</div><!--/fluid-row--> 



    <hr> 

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" 
     aria-hidden="true"> 

     <div class="modal-dialog"> 
      <div class="modal-content"> 
       <div class="modal-header"> 
        <button type="button" class="close" data-dismiss="modal">?</button> 
        <h3>Settings</h3> 
       </div> 
       <div class="modal-body"> 
        <p>Here settings can be configured...</p> 
       </div> 
       <div class="modal-footer"> 
        <a href="#" class="btn btn-default" data-dismiss="modal">Close</a> 
        <a href="#" class="btn btn-primary" data-dismiss="modal">Save changes</a> 
       </div> 
      </div> 
     </div> 
    </div> 

    <?php include_once('footer.php'); ?> 
</div><!--/.fluid-container--> 

<!-- external javascript --> 

<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> 

<!-- library for cookie management --> 
<script src="js/jquery.cookie.js"></script> 
<!-- calender plugin --> 
<script src='bower_components/moment/min/moment.min.js'></script> 
<script src='bower_components/fullcalendar/dist/fullcalendar.min.js'></script> 
<!-- data table plugin --> 
<script src='js/jquery.dataTables.min.js'></script> 

<!-- select or dropdown enhancer --> 
<script src="bower_components/chosen/chosen.jquery.min.js"></script> 
<!-- plugin for gallery image view --> 
<script src="bower_components/colorbox/jquery.colorbox-min.js"></script> 
<!-- notification plugin --> 
<script src="js/jquery.noty.js"></script> 
<!-- library for making tables responsive --> 
<script src="bower_components/responsive-tables/responsive-tables.js"></script> 
<!-- tour plugin --> 
<script src="bower_components/bootstrap-tour/build/js/bootstrap-tour.min.js"></script> 
<!-- star rating plugin --> 
<script src="js/jquery.raty.min.js"></script> 
<!-- for iOS style toggle switch --> 
<script src="js/jquery.iphone.toggle.js"></script> 
<!-- autogrowing textarea plugin --> 
<script src="js/jquery.autogrow-textarea.js"></script> 
<!-- multiple file upload plugin --> 
<script src="js/jquery.uploadify-3.1.min.js"></script> 
<!-- history.js for cross-browser state change on ajax --> 
<script src="js/jquery.history.js"></script> 
<!-- application script for Charisma demo --> 
<script src="js/charisma.js"></script> 
</body> 
</html> 

входа Страница

<?php 
session_start(); // Starting Session 
$error=''; // Variable To Store Error Message 
if (isset($_POST['submit'])) { 
if (empty($_POST['username']) || empty($_POST['password'])) { 
$error = "Username or Password is invalid"; 
} 
else 
{ 
// Define $username and $password 
$username=$_POST['username']; 
$password=$_POST['password']; 
// Establishing Connection with Server by passing server_name, user_id and password as a parameter 
$connection = mysql_connect("localhost", "root", ""); 
// To protect MySQL injection for Security purpose 
$username = stripslashes($username); 
$password = stripslashes($password); 
$username = mysql_real_escape_string($username); 
$password = mysql_real_escape_string($password); 
// Selecting Database 
$db = mysql_select_db("db_ecom", $connection); 
// SQL query to fetch information of registerd users and finds user match. 
$query = mysql_query("select * from login where password='$password' AND username='$username'", $connection); 
$rows = mysql_num_rows($query); 
if ($rows == 1) { 
$_SESSION['login_user']=$username; // Initializing Session 
header("location: ../Admin/index.php"); // Redirecting To Other Page 
} else { 
$error = "Username or Password is invalid"; 
} 
mysql_close($connection); // Closing Connection 
} 
} 
?> 

session.php страница

<?php 
// Establishing Connection with Server by passing server_name, user_id and password as a parameter 
$connection = mysql_connect("localhost", "root", ""); 
// Selecting Database 
$db = mysql_select_db("sungare_db", $connection); 
session_start();// Starting Session 
// Storing Session 
$user_check=$_SESSION['login_user']; 
// SQL Query To Fetch Complete Information Of User 
$ses_sql=mysql_query("select admin_name from login where admin_name='$user_check'", $connection); 
$row = mysql_fetch_assoc($ses_sql); 
$login_session =$row['admin_name']; 
if(!isset($login_session)){ 
mysql_close($connection); // Closing Connection 
header('Location: index.php'); // Redirecting To Home Page 
} 
?> 
+2

Можете ли вы показать код для ' C: \ wamp \ www \ sungare \ SungareAdmin \ listenquiries.php' между строками ~ 210 и ~ 220. В настоящий момент tl; dr. –

+0

Вопросы поиска справки по отладке («почему этот код не работает?») Должны включать в себя желаемое поведение, конкретную проблему или ошибку и кратчайший код, необходимый для воспроизведения в самом вопросе. Вопросы без четкого описания проблемы не полезны другим читателям. См.: [Как создать минимальный, полный и проверенный пример.] (Http://stackoverflow.com/help/mcve) – Epodax

+0

Я уже перенастроил весь код и строку 216 - последняя строка страницы – Sachin

ответ

0

это неправильно в вашем коде,

<? $count=$count+1;  

должно быть

<?php $count=$count+1; 

А также, если у вас есть пустые строки в нижней части, удалите их, Sometimed, что вызовет эту проблему (Это только в PHP файл)

Смежные вопросы