Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parse error: syntax error, unexpected '}' in /home/*****/public_html/index.php on....

    hii i can't resolve that problem it is write to me :
    Parse error: syntax error, unexpected '}' in /home/****/public_html/index.php on line 55
    i do ***** because it is the username and i dont wanna to be hacked.
    the code is:

    PHP Code:
    <?php
    include 'config.php';
    ?>
    <!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>
    <link rel="shortcut icon" href="favicon.ico" >
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Text header</title>
    <style type="text/css">
    .style1 {
    text-align: center;
    }
    .menu {
    background-image:url('bar.png')
    }
    .style2 {
    background-image: url('bar.png');
    text-align: center;
    margin-top: 0px;
    }
    .style4 {
    text-decoration: none;
    }
    .style5 {
    color: #FFFFFF;
    }
    .style6 {
    text-align: center;
    font-family: "Franklin Gothic Medium";
    font-size: large;
    text-decoration: underline;
    }
    .style7 {
    color: #FFFFFF;
    font-family: "Franklin Gothic Medium";
    }
    .style9 {
    text-align: center;
    font-family: "Franklin Gothic Medium";
    font-size: small;
    }
    </style>
    </head>

    <body>

    <p class="style1">
    <div class="style1">
    <img src="header.png" width="496" height="138" />
    </div>
    <center>
    <div class="style2" style="height: 63px; width: 580px">
    <html><br /><strong><span class="style5"><a href="index.php" class="style4"><span class="style7">Home</span></a></span><span class="style7"> |Games |&nbsp; <?php ($_COOKIE['uname']) ?> 's Profile | Send Email/Chat |
    <a href="logout.php" class="style4"><span class="style5">Logout</span></a> |<a href="contact.php" class="style4"><span class="style5">Contact Us</span></a></span></strong></html><?php } else { ?> <html> <div class="style2" style="height: 63px; width: 580px"><span class="style5"><a href="index.php" class="style4"><span class="style7">Home</span></a></span><span class="style7"> |<a href="register.php" class="style4"><span class="style5">Register</span></a> | <a href="login.php" class="style4"><span class="style5">Login</span></a> | <a href="contact.php" class="style4"><span class="style5">Contact Us</span></a></span></strong></div></html>
    <?php
    }
    ?>
    </center>
    <p class="style6"><strong>Big TEXT</strong></p>
    <p class="style9">TxtxtxtxtxtxtxtxSomethingblablablabla</p>
    <p class="style9">txtx txtxtxtxtxt:</p>
    <p class="style9">text text text text text text text</p>
    <p class="style9">something something something</p>
    <p class="style9">blalbalbalbalba</p>
    </body>

    </html>
    I hope you can help me
    thanks!
    Last edited by Fou-Lu; 10-13-2012 at 06:31 PM.

  • #2
    Regular Coder
    Join Date
    May 2007
    Posts
    101
    Thanks
    16
    Thanked 12 Times in 12 Posts
    The } at line 55 looks suspect

  • #3
    Regular Coder
    Join Date
    May 2007
    Posts
    101
    Thanks
    16
    Thanked 12 Times in 12 Posts
    The opening if is nowhere to be seen.

  • #4
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by >ssp-cdr< View Post
    The opening if is nowhere to be seen.
    I dont understand what to do.
    can you give me the fixed code?

  • #5
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,415
    Thanks
    269
    Thanked 32 Times in 31 Posts
    what ssp is saying is that for every { there needs to be a closing }

    so lets take your code and break it down here. Some coders jumble up the code all together and its madening to try to troubleshoot until you are able to follow it. So here is your first lesson, make it neat and document thats happening.

    PHP Code:

    <?php 
    include 'config.php'
    ?> 
    <!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> 
    <link rel="shortcut icon" href="favicon.ico" > 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Text header</title> 

    <!-- now lets do the css  -->
    <!-- remember for every open bracket there has to be a close bracket -->

    <style type="text/css"> 

    .style1 { 
        text-align: center; 


    .menu { 
        background-image:url('bar.png'); /*you misssed the ; here i added it */ 


    .style2 { 
        background-image: url('bar.png'); 
        text-align: center; 
        margin-top: 0px; 


    .style4 { 
        text-decoration: none; 


    .style5 { 
        color: #FFFFFF; 



    /* check quotes around the font family im not sure you need them or not */

    .style6 { 
        text-align: center; 
        font-family: "Franklin Gothic Medium"; 
        font-size: large; 
        text-decoration: underline; 


    .style7 { 
        color: #FFFFFF; 
        font-family: "Franklin Gothic Medium"; 


    .style9 { 
        text-align: center; 
        font-family: "Franklin Gothic Medium"; 
        font-size: small; 


    </style> 

    </head> 

    <body> 

    <p class="style1"> 

    <div class="style1"> 
    <img src="header.png" width="496" height="138" /> 
    </div> 

    <center> 
     <div class="style2" style="height: 63px; width: 580px"> 

        <html><br />
        <strong><span class="style5">
         <a href="index.php" class="style4">
           <span class="style7">Home</span></a>
          </span>

          <span class="style7"> |Games |&nbsp; 



    <?php 

    //i think this should be your if statement here 

    if ($_COOKIE['uname'])
     {

      
    ?> 

    's Profile | Send Email/Chat |     
        <a href="logout.php" class="style4"><span class="style5">Logout</span></a> |<a href="contact.php" class="style4"><span class="style5">Contact Us</span></a></span></strong></html>

    <?php } else { ?> 

    <html> <div class="style2" style="height: 63px; width: 580px"><span class="style5"><a href="index.php" class="style4"><span class="style7">Home</span></a></span><span class="style7"> |<a href="register.php" class="style4"><span class="style5">Register</span></a>     | <a href="login.php" class="style4"><span class="style5">Login</span></a> |    <a href="contact.php" class="style4"><span class="style5">Contact Us</span></a></span></strong></div></html> 


        <?php 
        
    }    //here is your problem  there is no open bracket where is it
              //there should be an if statement or something to go with this, i added one for you
              
        
    ?> 




    </center> 
    <p class="style6"><strong>Big TEXT</strong></p> 
    <p class="style9">TxtxtxtxtxtxtxtxSomethingblablablabla</p> 
    <p class="style9">txtx txtxtxtxtxt:</p> 
    <p class="style9">text text text text text text text</p> 
    <p class="style9">something something something</p> 
    <p class="style9">blalbalbalbalba</p> 
    </body> 

    </html> 
    I hope you can help me 
    thanks!

    i documented it inside your code above.
    you missed a ; in style
    you need to check if you need the quotes on font family i dont think you do
    i added the if to your statement
    Last edited by durangod; 10-13-2012 at 12:13 PM.

  • #6
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by durangod View Post
    what ssp is saying is that for every { there needs to be a closing }

    so lets take your code and break it down here. Some coders jumble up the code all together and its madening to try to troubleshoot until you are able to follow it. So here is your first lesson, make it neat and document thats happening.

    PHP Code:
    I DELETE THE CODE!!!! 

    i documented it inside your code above.
    you missed a ; in style
    you need to check if you need the quotes on font family i dont think you do
    i added the if to your statement
    Thanks but i fixed the error without your help.
    can you help me please here?:
    http://www.codingforums.com/showthread.php?t=276794
    Thanks!!
    Last edited by sahkan_dengran; 10-13-2012 at 01:07 PM.

  • #7
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,415
    Thanks
    269
    Thanked 32 Times in 31 Posts
    Certainly no need to be rude about it but, since you are new here let me explain what we like to do here in the php section and some other sections.

    If you happen to fix the problem on your own or you find another solution or you just dont need help anymore, the courtious thing to do would be to edit your first thread of your post (this goes for any of your questions) and then select advanced and then select resolved.

    This lets us know that you no longer need help, and it keeps things like this from happening that i spend time on this and you dont even need help anymore.

    I will take a look at your other thread, if i can help i will.

  • #8
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by durangod View Post
    Certainly no need to be rude about it but, since you are new here let me explain what we like to do here in the php section and some other sections.

    If you happen to fix the problem on your own or you find another solution or you just dont need help anymore, the courtious thing to do would be to edit your first thread of your post (this goes for any of your questions) and then select advanced and then select resolved.

    This lets us know that you no longer need help, and it keeps things like this from happening that i spend time on this and you dont even need help anymore.

    I will take a look at your other thread, if i can help i will.
    Thanks i really sorry that i forget to wrote that i found a solution.
    SORRY!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •