Unstoppable Domains

PHP Syntax Error

Spaceship Spaceship
Watch

lpxxfaintxx

Established Member
Impact
13
PHP:
<?php
	require_once "maincore.php";
	session_start();
	session_checker(); 
	require_once "connect.php";

if(isset($_GET['and'])) {

echo <<<__HTML_END

	Upload Successful! <a href="membersarea.php">Click Here to Continue...</a>

__HTML_END;

} else {


echo <<<__HTML_END
	<center>
	<u>Navigation:</u><Br><br><br>
	<a href="myfiles.php">My files<br><a>
	<a href="upload.php">Upload New File<br></a>
	Edit Profile<br>
	<br><br>
	<a href="logout.php">Log Out</a>
__HTML_END;


if($_SESSION['user_level'] == 1){
echo <<<__HTML_END
	Welcome, $username. You are a Moderator. <Br><br>
	<a href="today.php?view=files">Todays Upload</a>
	<a href="today.php?view=users">New Registed Members Today</a>
	<a href="logout.php">Log Out</a>
__HTML_END;
}
if($_SESSION['user_level'] == 2){
echo <<<__HTML_END
	Welcome, $username. You are an Administrator.
	<a href="today.php?view=files">Todays Upload</a>
	<a href="today.php?view=users">View All Uploads</a>
	<a href="today.php?view=users">New Registed Members Today</a>
	<a href="today.php?view=files">View All Members</a>
	<a href="logout.php">Log Out</a>

__HTML_END;
}}

?>


Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/informed/public_html/projects/membership/membersarea.php on line 51


I REALLY don't know where I went wrong. Looked everywhere, but just can't find it. Anyone care to show me where I went wrong?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
This file does not have 51 lines of code, it only has 49, but my "guess" would be at the end, were you have the }} back to back, remove the second one.
 
0
•••
Is the code you posted membersarea.php?

PHP:
<?php

require_once "maincore.php";
session_start();
session_checker(); 
require_once "connect.php";

if(isset($_GET['and'])) {
	?>
		Upload Successful! <a href="membersarea.php">Click Here to Continue...</a>
	<?php
} else {
	?>
		<center>
		<u>Navigation:</u><Br><br><br>
		<a href="myfiles.php">My files<br><a>
		<a href="upload.php">Upload New File<br></a>
		Edit Profile<br>
		<br><br>
		<a href="logout.php">Log Out</a>
	<?php
	if($_SESSION['user_level'] == 1){
		?>
			Welcome, $username. You are a Moderator. <Br><br>
			<a href="today.php?view=files">Todays Upload</a>
			<a href="today.php?view=users">New Registed Members Today</a>
			<a href="logout.php">Log Out</a>
		<?php
	}
	if($_SESSION['user_level'] == 2){
		?>
			Welcome, $username. You are an Administrator.
			<a href="today.php?view=files">Todays Upload</a>
			<a href="today.php?view=users">View All Uploads</a>
			<a href="today.php?view=users">New Registed Members Today</a>
			<a href="today.php?view=files">View All Members</a>
			<a href="logout.php">Log Out</a>
		<?php
	}
}

?>

Try that?
 
0
•••
I agree,

what's with all the:

echo <<<__HTML_END stuff? you don't need all that rubbish to produce the same code you are trying to produce. In fact, I'm not sure why you do that, but to each is their own :)

What about simple string functions?

$html = 'my html code here';
echo $html;

Will save you more time in the end. :)
 
0
•••
Sorry for not keeping you guys updated. I have fixed the problem long before, but thanks for your efforts.

@psalzmann : echo <<<__HTML_END is my preference, and I feel more comfortable with it. It also helps me produce MUCH more less errors.
 
0
•••
lpxxfaintxx: I bet you were a Perl coder at one stage :)

Like Dan Friedman did in his example, I prefer to just 'break out' of the PHP interpreter by using a closing PHP tag then writing HTML directly, but I do appreciate the old-school feel of a heredoc!
 
0
•••
The code is correct but error can be in "require" fields : maincore.php, connect.php

Regards
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back