Jump to content

Recommended Posts

Hi Guys,

 

Im making a website for a friend have encountered a really annoying problem. When every i run the script below i get this error: "Parse error: syntax error, unexpected '}' in /home/a1408362/public_html/members.php on line 36". I've tried everything i can think of but just cant fix it.

 

Here's the code:

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Radio Ilam | Radio of the Suburbs</title><meta name="keywords" content="music note, free template, website template, CSS, XHTML" /><meta name="description" content="Music Note - free CSS template provided by templatemo.com" /><link href="templatemo_style.css" rel="stylesheet" type="text/css" /><style type="text/css">

.style1 {

text-align: center;

}

.style2 {

font-weight: bold;

color: #C32929;

}

.style3 {color: #FF0000}

</style></head>

 

<body>

 

<?php

// Connects to your Database

mysql_connect("mysql3.000webhost.com", "a1408362_georgeb", "dryduck18") or die(mysql_error());

mysql_select_db("a1408362_data") or die(mysql_error());

 

 

//checks cookies to make sure they are logged in

if(isset($_COOKIE['ID_my_site']))

{

$username = $_COOKIE['ID_my_site'];

$pass = $_COOKIE['Key_my_site'];

$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());

while($info = mysql_fetch_array( $check ))

{

 

 

//if the cookie has the wrong password, they are taken to the login page

if ($pass != $info['password'])

{ header("Location: login.php");

}

 

//if user is administrator then go to admin view

 

if ($username = "administrator")

{header("Location: admin.php")

}

 

//otherwise they are shown the admin area

else

{

}

 

 

else

 

//if the cookie does not exist, they are taken to the login screen

{

header("Location: login.php");

}

?>

 

 

<div id="templatemo_container_wrapper">

<div id="templatemo_container">

  <div id="templatemo_header">

<div id="templatemo_site_title">Radio<span class="style2">Ilam</span></div>

      <div id="templatemo_site_slogan">Radio of the Suburbs</div>

</div>

   

<div id="templatemo_menuleft"></div>   

<div id="templatemo_menu">

        <ul>

<li><a href="index.html">Home</a></li>

  <li><a href="competitions.php">Competitions</a></li>

<li><a href="#">Lates Music</a></li>

            <li><a href="#" class="current">Members</a></li>

            <li><a href="#">Listen Live</a></li>

            <li><a href="#">Contact Us</a></li>

        </ul>   

    </div>

   

  <div id="templatemo_content">

<div id="templatemo_left_column">

        <div class="templatemo_section2">

          <h1>Members</h1>

          <p>Welcome

 

<?php

echo $username

?>

          <p><a href="logout.php">Logout</a></p>

        </div>

        <br />

           

</div>

       

<div id="templatemo_right_column">

        <h1>Members</h1>

        <h3>Song of the Week:</h3>

        <table width="540" height="126" border="0">

              <tr>

                <td width="139" rowspan="2"><div align="center"><img src="muse-the-resistance.jpg" width="138" height="133" /></div></td>

                <td width="391" height="71">Muse - Uprising</td>

              </tr>

              <tr>

                <td>

               

               

<object type="application/x-shockwave-flash" data="player_mp3.swf" width="200" height="20">

    <param name="movie" value="player_mp3.swf" />

    <param name="FlashVars" value="mp3=uprising.mp3" />

</object>

               

                 </td>

              </tr>

            </table>

        <p> 

           

         

           

            </p>

</div>

</div>

<div id="templatemo_footer">Copyright © 2009 RadioIlam<a href="#"></a></div>

 

</div>

</div>

</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/183179-big-problem-please-help/
Share on other sites

Your while loop doesn't terminate.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Radio Ilam | Radio of the Suburbs</title><meta name="keywords" content="music note, free template, website template, CSS, XHTML" /><meta name="description" content="Music Note - free CSS template provided by templatemo.com" /><link href="templatemo_style.css" rel="stylesheet" type="text/css" /><style type="text/css">
.style1 {
   text-align: center;
}
.style2 {
   font-weight: bold;
   color: #C32929;
}
.style3 {color: #FF0000}
</style></head>

<body>

<?php
// Connects to your Database
mysql_connect("mysql3.000webhost.com", "a1408362_georgeb", "dryduck18") or die(mysql_error());
mysql_select_db("a1408362_data") or die(mysql_error());


//checks cookies to make sure they are logged in
if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
//if the cookie has the wrong password, they are taken to the login page
if ($pass != $info['password'])
{ header("Location: login.php");
}

//if user is administrator then go to admin view

if ($username = "administrator")
{header("Location: admin.php")
}

//if the cookie does not exist, they are taken to the login screen
else{   
header("Location: login.php");
}
}
?>


<div id="templatemo_container_wrapper">
<div id="templatemo_container">
  <div id="templatemo_header">
      <div id="templatemo_site_title">Radio<span class="style2">Ilam</span></div>
      <div id="templatemo_site_slogan">Radio of the Suburbs</div>
   </div>
   
   <div id="templatemo_menuleft"></div>   
   <div id="templatemo_menu">
        <ul>
         <li><a href="index.html">Home</a></li>
            <li><a href="competitions.php">Competitions</a></li>
<li><a href="#">Lates Music</a></li>
            <li><a href="#" class="current">Members</a></li>
            <li><a href="#">Listen Live</a></li>
            <li><a href="#">Contact Us</a></li>
        </ul>       
    </div>
   
  <div id="templatemo_content">
      <div id="templatemo_left_column">
            <div class="templatemo_section2">
              <h1>Members</h1>
              <p>Welcome
         
         <?php
         echo $username
         ?>
              <p><a href="logout.php">Logout</a></p>
            </div>
           <br />
           
      </div>
       
      <div id="templatemo_right_column">
           <h1>Members</h1>
           <h3>Song of the Week:</h3>
           <table width="540" height="126" border="0">
              <tr>
                <td width="139" rowspan="2"><div align="center"><img src="muse-the-resistance.jpg" width="138" height="133" /></div></td>
                <td width="391" height="71">Muse - Uprising</td>
              </tr>
              <tr>
                <td>
               
               
<object type="application/x-shockwave-flash" data="player_mp3.swf" width="200" height="20">
     <param name="movie" value="player_mp3.swf" />
     <param name="FlashVars" value="mp3=uprising.mp3" />
</object>
               
                 </td>
              </tr>
            </table>
           <p> 
           
         
           
            </p>
      </div>
   </div>
   <div id="templatemo_footer">Copyright © 2009 RadioIlam<a href="#"></a></div>

</div>
</div>
</body>
</html>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.