解析错误:语法错误,意外的文件结束

时间:2017-02-08 08:47:12

标签: php html forms session parse-error

它首先工作,但是当我重新编辑它,因为它看起来很乱,结果现在是错误的,有人可以帮助我。

我想我已经关闭了大括号和脚本,我不知道它有什么问题。

<?php
session_start();
require("functions.php");
if(!isset($_GET['id'])&&isset($_SESSION['username'])) header("Location: ?id=".getId($_SESSION['username']));
?>

<!-- HEAD -->

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>System of Account</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script>

    <link rel="stylesheet" href="animate.css">
    <link href="fonts/css/font-awesome.min.css" rel="stylesheet">

    <link rel="shortcut icon" href="favicon.png">
    <link href="css/animate.min.css" rel="stylesheet">
   <link href="fonts/css/font-awesome.min.css" rel="stylesheet">
   <link rel="stylesheet" type="text/css" media="print" href="print.css" />
<!--<link type="text/css" rel="stylesheet" href="styles.css" />-->

<style>

     body{
    margin: 0 auto;
    background-image:url("../clsimages/GG.jpg");
    background-repeat: no-repeat;
    background-size: 100% 720px;
    -webkit-background-size:cover;
    -moz-background-size:cover;
    -o-background-size:cover;

}

.container{
    width: 65%;
    height:615px;
    background-color: rgba(52, 73, 94, 0.3);
    margin-top: 50px;
    border-radius:4px;
    border: 2px solid black;
}

</style>

 <style>
table{
 float:left;
 border: 1px solid ;
}

</style>

    <style>

ul {
    width: 70%;
    margin: auto;
}

</style>

<style>

.div{
    width: 250%;
}
.form-control{
    border: 2px dashed #D1C7AC;
    width: 230px;
    color: #1E049E;
    onfocus="this.value=''
    font-weight: bold;
    font-size: 18px;
    font-family: "Times New Roman";

}


</style>

<script>
        function printDiv(divID) {
            //Get the HTML of div
            var divElements = document.getElementById(divID).innerHTML;
            //Get the HTML of whole page
            var oldPage = document.body.innerHTML;

            //Reset the page's HTML with div's HTML only
            document.body.innerHTML = 
              "<nav>" + 
              divElements + "</nav>";

            //Print Page
            window.print();

            //*Restore orignal HTML
           // document.body.innerHTML = oldPage;
      // window.location='print.php'; 
        }
    </script>

</head>

<!-- BODY -->

<body>

<div id="container">

<?php 

  if(!isset($_SESSION['username']))
  { 

?>

 </br></br></br></br></br></br></br></br></br></br>

 <center>

 <font color="black"> <h2 class="form-signin-heading"> Please Login <i class="fa fa-sign-in"> </i></h2> </font>

  </br></br>

   <form action="authenticate.php"  class="form-signin" method="POST">
      <div class="input-group" style="margin-left:42%">
      <span class="input-group-addon" id="basic-addon1">Username:</span>
      <input type="text" name="username" class="form-control"  style="width:23%; height: 40px;" required><br />
        </div>

        </br>

         <div class="input-group" style="margin-left:42%">
         <span class="input-group-addon" id="basic-addon1" >Password:</span>
         <input type="password" name="password" id="inputPassword" class="form-control" placeholder="Enter Your Password" style="width:23%; height:40px;"required>
         </div>

         <br /> </br>

          <button class="btn btn-lg btn-primary btn-block" type="submit" style="width:25%;">  Login <i class="fa fa-sign-in"> </i> </button>
      </center>
     </form>

    <?php 

    if(isset($_GET["feedback"]))

      echo $_GET["feedback"]; 
  }

  ?>

  <!-- NEXT PAGE -->


<?php 
  if(isset($_SESSION['username']))
  {
     $profileUsersData = getUsersData(mysql_real_escape_string($_GET['id']));
    ?>
        <div id="menu">
            <a class="button" href="logout.php">Logout</a>
        </div>

<?php if(userExists(mysql_real_escape_string($_GET['id']))){ ?>

<!--Button print -->

<button class="btn btn-default" onclick="javascript:printDiv('printablediv')"  class = "btn btn-success"  ><i class="fa fa-print"> </i> <b> Print the fees</b></button>

<!-- End -->



<!--PRINT -->


<div class="" id="printablediv">

  <p><img src="clsimages/STATEMENT.png"></p>


<div align="right">

<script>

        var y = new Date();
        var currentyear = y.getFullYear();
        var nextyear= y.getFullYear() +1;
        document.write("<p class='navbar-text pull-right'><font style = 'Impact' color = 'black'><h3> SY:<font color='blue'> "+ currentyear +"-"+ nextyear +" </h3></font></font></p>");

</script> </th>

</div>

<br>

<!-- Table -->

<table border='1' style='border-collapse:collapse; width:100%; border-bottom: hidden;'>
  <col style='width:50%;'>
  <tr>
    <td>
      <ul>
      <p><font size='2%' face='Arial'> <b>
        </br>

        <?php


            if(isset($_SESSION['username']))
    {
         $profileUsersData = getUsersData(mysql_real_escape_string($_GET['id']));
        ?>


        <?php if(userExists(mysql_real_escape_string($_GET['id']))){ ?>
        <div id="header">

        <?php echo 'STUDENT NAME: '. $profileUsersData['LastName'].", ".$profileUsersData['FirstName']. " ".$profileUsersData['MiddleName'].""; ?>

      </br></br>
        <?php echo ' </br> LEVEL: '. $profileUsersData['Level'].""; ?>
    </b>
  </ul>
</td>

<td>
  <ul>
    <p><font size="2%" face="Arial"><b> TELEPHONE: (63 2) 834-2915 
      </br></br>
      EMAIL: christianloveschool@yahoo.com 
    </p>
    </b>
  </ul>
  </table>

  <table border="1" style="border-collapse:collapse; width:100%;">
     <col style="width:50%;">
    <tr>
      <td>
        <ul>
        <font size="2%" face="Arial"> 
          <b>
        <?php echo ' </br> DATE: '. $profileUsersData['TuitionDate'].""; ?>
          <b>
          </br>
        <?php echo ' </br> TUITION FEE: '. $profileUsersData['Tuition'].""; ?>
          </br> </br>
         <?php echo ' </br> BOOKS: '. $profileUsersData['Books'].""; ?>
          </br> </br>
        <?php echo ' </br> SCHOOL/ PE UNIFORM: '. $profileUsersData['Uniform'].""; ?>
          </br> </br>
        <?php echo ' </br> OLD ACCOUNT: '. $profileUsersData['OldAcct'].""; ?>
        </br>
        </b>
       </ul>
      </td>
    </font>

      <td>
        <font size="2%" face="Arial">
        <ul>
          <b>
    <?php echo ' </br> BALANCE: '. $profileUsersData['Balance'].""; ?>
      </b>
      </ul>
      </td>
         </font>
    </tr>
  </table>

 <?php } else echo "Invalid ID"; ?>

 <?php } ?>

 <!-- RULES OF PAYMENT -->

 <table border="1" style="border-collapse:collapse; width:100%; border-top:hidden;">
    <tr>
      <td>
        <font size="3%" face="Arial">

          <ul>

             <b><u>RULES ON PAYMENT:</u></b>
        </font>

      </br></br>

        <font size="2%" face="Arial">

          1. Tuition fee payment must be made every 5th day of the scheduled payment scheme. </br></br>
          2.Payments should be made on time in order to take the exam needed. </br></br>
          3. Reservations and Miscellaneous fees are non-refundable. </br></br>
          4.A student who withdraws before the start of the school year shall be charged 50% on miscellaneous fee. </br></br>
          5. A student who transfers or otherswise withdraws within two weeks after the beginning of classes and has already paid the
          pertinent and other school fees in full may be charged to pay the whole amount of miscellaneous fees and the amount supposed tp be paid pertaining to tuition fee. </br></br>
          6. A student who transfers or withdraws within two weeks after the beginning of classes and has not yet paid the pertinent
          and other school fees shall be charged to pay the whole amount of miscellaneous fees in full and the amount supposed to be paid pertaining to tuition fee. </br></br>
          7. A student who withdraws any time after the second week of classes, full payment of tuition and miscellaneous fees shall be charged. </br></br>
          8. Discounts shall only be applied at the last payment. </br></br>
          9. Any discounts granted will be forfeited if the payment is delayed. </br></br>
          10. All fees should be paid in full before the end of the school year.
        </font>

        </br></br>

        <hr></hr>

        <br>

        <table>
    <font size="3%">
          Any discount granted will be <b> forfeited </b> if the payment is delayed.

    <br>

    <u> <font color="red"> <b>

     <br>

           Bring this notice upon payment and have the Examination Permit validated from the office.
    </font> </u>
    </table>

    </br></br>

          <font color="blue" size="3%">

            Contact the school if payment has been made, thank you.

         </u> </font> </b>

     </ul>
 </table>
</td>
</tr>

</div>
</div>

</body>
</html>

2 个答案:

答案 0 :(得分:0)

以下if循环的括号未关闭

 if(isset($_SESSION['username'])){

<?php if(userExists(mysql_real_escape_string($_GET['id']))){ ?>

答案 1 :(得分:0)

引用I think i already closed the braces - 不,你没有。

您的代码包含12个{个实例,但只包含10个}个实例。看起来有一个问题是171号线上的支架没有关闭,而且某处可能还有1个