...

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



sahkan_dengran
10-13-2012, 09:45 AM
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
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!

>ssp-cdr<
10-13-2012, 09:51 AM
The } at line 55 looks suspect ;)

>ssp-cdr<
10-13-2012, 09:54 AM
The opening if is nowhere to be seen.

sahkan_dengran
10-13-2012, 10:02 AM
The opening if is nowhere to be seen.

I dont understand what to do.
can you give me the fixed code?

durangod
10-13-2012, 01:07 PM
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
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

sahkan_dengran
10-13-2012, 01:53 PM
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.



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!!

durangod
10-13-2012, 02:23 PM
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. :mad:

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

sahkan_dengran
10-13-2012, 02:26 PM
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. :mad:

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!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum