Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-23-2012, 01:22 AM   PM User | #1
GameAnger
New Coder

 
Join Date: Aug 2011
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
GameAnger is an unknown quantity at this point
Exclamation Parse Error: Unexpected $End

Hey everyone, I've been working on this for a while now and cannot seem to figure out the reason. Ive been getting this sort of error on my profile.php page:

Parse error: syntax error, unexpected $end in /home/gameange/public_html/profile.php on line 1457

Line 1457 is at the very end of the code, and I can't seem where the error starts.

I know that there is a lot of code, but here is the paste: http://paste2.org/p/1913238

If anybody would be kind enough to help me out here it would be greatly appreciated!
GameAnger is offline   Reply With Quote
Old 02-23-2012, 01:31 AM   PM User | #2
Serex
Regular Coder

 
Join Date: Mar 2004
Location: Australia
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Serex is an unknown quantity at this point
Have you tried closing your PHP tags?

PHP Code:
<?php
$bDayMSG 
"";
$today date("Y-m-d");
$birthday $row['birthday'];
if (
$today == $birthday) {
  
$bDayMSG "Happy Birthday! We wish you the best of luck, for this day only comes once a year! Get off of VGAnger and go spend some time with your family!";
}
$birthday strftime("%b %d, %Y"strtotime($birthday));
?>
<div id="msg">
<div class="txt">
<?php
echo $bDayMSG// Wherever you need it on the page
?>

</div>
</div>
</body>
</html>
Serex is offline   Reply With Quote
Old 02-23-2012, 01:38 AM   PM User | #3
GameAnger
New Coder

 
Join Date: Aug 2011
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
GameAnger is an unknown quantity at this point
Went through them all (at least I'm pretty sure I did). I dont think its the problem of ending tags. But, I;m not sure
GameAnger is offline   Reply With Quote
Old 02-23-2012, 02:07 AM   PM User | #4
Mahdi Eftekhari
New Coder

 
Join Date: Feb 2012
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Mahdi Eftekhari is an unknown quantity at this point
Quote:
Originally Posted by GameAnger View Post
Line 1457 is at the very end of the code, and I can't seem where the error starts.
On line 1443 you have opened a PHP tag and then on line 1454 you have opened another one without closing the previous one. And then again on line 1457 without closing php tag you have inserted HTML code. Try closing these two tags and check it.

Regards
Mahdi Eftekhari
Mahdi Eftekhari is offline   Reply With Quote
Users who have thanked Mahdi Eftekhari for this post:
tangoforce (02-23-2012)
Old 02-23-2012, 10:19 AM   PM User | #5
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,513
Thanks: 45
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
As Mahdi says, you need to ensure that you always put in closing braces.

To be sure you do, when you open a new brace put in a closing one. After the opener, hit enter twice, type in the closing brace and then use the arrow key to go up and write your code in between. This technique has helped me immensely over the years.

Also see the coding styles and $end errors link in my signature. That topic is especially designed to help people like you with this problem.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 02-23-2012, 12:57 PM   PM User | #6
myfayt
Senior Coder

 
Join Date: Apr 2010
Posts: 1,156
Thanks: 46
Thanked 95 Times in 94 Posts
myfayt can only hope to improve
Also in my experience, that closing bracket can be anywhere in the code, mostly it's at the bottom of the script for me, but I've had it at the top. When I write code, and open a new bracket, I make the closing bracket as well, as a reminder. I drop the closing bracket down a few lines while im coding to get it out of the way.
__________________
Been a sign maker for 5 years. My business:
American Made Signs
myfayt is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:46 AM.


Advertisement
Log in to turn off these ads.