Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
293 views
in Technique[技术] by (71.8m points)

PHP PDO, Parse error: syntax error, unexpected $end

Hi I am new to using php and PDO.I am trying to receive data form a data base using sessions. I am currently getting the following error: Parse error: syntax error, unexpected $end in /home/atlismap/public_html/profile.php on line 163

 <?php

 require_once 'check.php';

  $full_name = "";
  // IF CONDITION TO IS TRUE LOCAL VARIBALES WILL BE CREATED FOR THE SESSION.
   if(isset($_SESSION['uid']) && isset($_SESSION['username']) && isset($_SESSION['password'])){
    $full_name = $_SESSION['full_name'];
    $stmt = $dtb->prepare("SELECT id, username, full_name, bio, country FROM users WHERE full_name=:full_name");
    $stmt->bindValue(':full_name',$full_name,PDO::PARAM_INT); // ID IS ONLY GOING TOBE AN INTEGER
    //
    try{
        $stmt->execute();
         if($stmt->rowCount() > 0){
             // IF USER EXISTS AND THE SESSION STATMENTS ARE TRUE THEN THE USER_IS_LOGED AVRIABLE WILL BE CHANGES TO TRUE.
             $user_is_logged = true;
         }
    } 
    // CATHC ERRORS FROM QUERY.
    catch(PDOException $e){
        return false;
    }

  ?>

  <!DOCTYPE html>
  <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7">  <![endif]-->
  <!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8">             <![endif]-->
  <!--[if IE 8]>         <html class="no-js lt-ie9">                      <!  [endif]-->
  <!--[if gt IE 8]>    <!--> <html class="no-js">                   <!--<![endif]-->
    <head>

    <title> Atlis | Profile </title>

    <!-- META DATA -->
    <meta charset="UTF-8">
    <meta name="description" content="Atlis is your online travel bucket/wish list created using a map.">
    <meta name="keywords" content="Atlis, Travel Wish List, Travel Bucket Lsit, Interactive Maps, Google Map API, Erin-Katie Strapp">
    <meta name="author" content="Erin-Katie Strapp">
    <meta name="viewport" content="width=device-width, initial-scale = 1.0">

    <!-- CSS -->
    <link rel="stylesheet" type="text/css" href="stylesheets/reset.css"><!-- NORMAILISE STYLESHEET WILL RESSET THE BROWSER DEAFUALT STYLES --> 
    <link rel="stylesheet" type="text/css" href="stylesheets/grid.css"><!-- GRID.CSS WILL HELP PREPARE THE MARK-UP OF GOING RESPONSIVE -->
    <link rel="stylesheet" type="text/css" href="stylesheets/screen.css"><!-- THE MAIN.CSS WILL CONTAIN ALL THE MAIN CUSTOMED STYLES FOR THE SITE -->
    <link rel="stylesheet" type="text/css" href="stylesheets/media_queries.css"><!-- THE MEDIA QUERY STYLESHEET MAKES THE SITE MOBILE READY BY ADAPTING THE STYLE TO FIT THE SCREEN SIZE. -->

    <!-- SCRIPTS -->
    <script src="scripts/vendor/modernizr-2.6.2.min.js"></script><!-- USING THIS SCRIPT WILL FILE WILL HELP MAKE SURE THAT THE SITE IS COMPATIBALE ON DIFFERENT PLATFORMS EVEN WHEN USING HTML5 -->


</head>


<body id="wrap">

    <!--[if lt IE 7]>
        <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->



        <div id="content">

            <header>

                <img src="images/profile/small-logo.png" alt="Atlis Logo" class="smlLogo" />

                <nav class="settings-menu">
                  <ul class="options">
                    <li>
                      <a href="#" class="icon"><img src="images/profile/settings.png" alt="settings"/></a>
                      <ul>
                        <li><a href="logout.php" class="settings-link">Logout</a></li>
                        <li><a href="#editBio" class="settings-link modalLink">Edit Profile</a></li>
                      </ul>
                    </li>
                  </ul>
                </nav><!-- CLOSES SETTINGS MENU -->
            </header>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

            <section id="google_map"></section>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

            <div id="profileContainer">

                <section id="profile">

                    <div class="avatar-frame">
                        <img src="images/test.jpg" alt="test" />
                    </div><!-- CLOSES AVATAR FRAME -->

                    <p class="profileUsername">Hello</p>
                    <p class="bio">

                    </p>
                </section><!-- CLOSES PROFILE SECTION -->

                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

                <section id="travelList">

                    <h2 class="profileTitle">My Travel List</h2>

                    <p class="travelList"></p>
                    <p> </p>

                </section><!-- CLOSES TRAVEL LIST SECTION --> 

                 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

                <section id="copyright">

                    <p>Copyright @ www.erin-katie.com 2014</p>

                </section><!-- CLOSES COPYRIGHT SECTION  -->

     <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->


                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

            </div><!-- CLOSES PROFILE CONTAINER DIV -->

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

        </div><!-- CLOSES CONTENT DIV -->

        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

         <div class="overlay"></div><!-- OVERYLAY IS THE BACKGROUND THAT APPEARS UNDERNEATH THE MODAL BOXES -->

        <div id="editBio" class="modal">
            <h2 class="homeForm">Edit Profile</h2>
            <img src="images/homepage/close.png" alt="close" class="closeBtn" onmouseover="this.src='images/homepage/close-hover.png';" onmouseout="this.src='images/homepage/close.png';"/>


            <form action="bio.php" method="post" class="form" id="loginForm">
                <input type="text" name="username" placeholder="Edit username" tabindex="1" autofocus><br />
                <input type="text" name="full_name" placeholder="Edit full name" tabindex="1" autofocus><br />
                 <input type="text" name="country" placeholder="Edit country" tabindex="1" autofocus><br />
                <textarea rows="4" cols="50" name="bio"placeholder="Edit biograpphy"></textarea>
               <!--  <input type="file" name="file" id="file"><br> -->
                <button type="submit" class="signInBTN">Done</button>
            </form><!-- CLOSES REGISTARTION FORM -->


        </div><!-- CLOSES EDITBIO DIV MODAL -->


</body>

<!-- SCRIPTS -->
<script type="text/javascript" src="scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript"src="https://maps.googleapis.com/maps/api/js?sensor=true"></script><!-- LINK TO GOOGLE MAP API -->
    <script type="text/javascript" src="scripts/map.js"></script><!-- JAVASCRIPT FILE FOR MAP API -->
    <script type='text/javascript' src='scripts/jquery.modal.js'></script><!-- PLUGIN FOR FORM-POP-UP -->
    <script type="text/javascript" src="scripts/scripts.js"></script>

</html>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Just Realised that I left out the one of the closing curly brackets.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...