-3

I have created a login form. After a successful login, the user can see the data present on listenquiries.php page. However, I'm unable to display my page. At the time of submitting, I am getting following error:

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>

login Page

<?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 page

<?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
}
?>
Sachin
  • 19
  • 4
  • 2
    Can you show the code for `C:\wamp\www\sungare\SungareAdmin\listenquiries.php` between line ~210 and ~220. At the moment, tl;dr. – Jonnix Oct 23 '15 at 08:23
  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example.](http://stackoverflow.com/help/mcve) – Epodax Oct 23 '15 at 08:25
  • i have already mensioned all code & line 216 is last line of the page – Sachin Oct 23 '15 at 08:25
  • 1
    A piece of advice. If you want help, you have to help us help you. It's really annoying when people try to tell us that we have all the information we need when you can't solve it. Now, given current information, I'd start by replacing your `` with ` – Jonnix Oct 23 '15 at 08:29
  • i have been replaced with – Sachin Oct 23 '15 at 08:36
  • It would be useful to see the complete `parse error` message and not just a little piece of it. Fixing parse errors is Debugging 101 see this http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them – RiggsFolly Oct 23 '15 at 08:37

1 Answers1

0

this is wrong in your code,

<?    $count=$count+1;     

it should be

<?php    $count=$count+1;   

And also if you have empty lines at bottom, remove them, Sometimed that will cause this problem (This is only in php file)

Niranjan N Raju
  • 12,047
  • 4
  • 22
  • 41