Click here to Skip to main content
15,896,502 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi
working on this project, I am now trying to authenticate a user when they login and they login it, it should take the user to a welcome back page but I am seriously getting error and would like to know how to fix it.

here is what I have tried.

What I have tried:

PHP
<pre>

		<div id="contentArea">
			<?php
					session_start();
					if(!session_is_registered("username"))
					{
						header("location:login_user.php")
					}this the error: <pre>

		<div id="contentArea">
			<?php
					session_start();
					if(!session_is_registered("username"))
					{
						header("location:login_user.php")
					}
			?>
			<?php
					echo "Welcome back " . $_SESSION['username'];
			?>
		
		
		
			
			
			<div id="footerbox">
				
					<div id="footerholder">
						<div id="">
						
							<a href="browsenationalwonders.php">Browse National Wonders</a>
							<a href="updateprofile.php">Update Profile</a>
							<a href="postnaturalwonder.php">Post Natural Wonders</a>
							<a href="logout.php">Logout</a>
							
								
								
						</div>
					
					</div>
			</div>
		</div>
		
	</body>
			
</html>

?>






Posted
Updated 7-Apr-19 10:31am
Comments
Patrice T 7-Apr-19 16:12pm    
And you plan to tell what error ?
divinity02 7-Apr-19 16:20pm    
sorry about that, thought I had posted the error, it is below

the error is:
Parse error: syntax error, unexpected '}' in C:\wamp64\www\Taylor_Luana_ITEC244_Assignment\php\welcome_back.php on line 43



PHP
<pre><?php
					session_start();
					if(!session_is_registered("username"))
					{
						header("location:login_user.php")
					}<--which is this right here
			
			?>
 
Share this answer
 
PHP
<?php
    session_start();
    if(!session_is_registered("username"))
    {
    	header("location:login_user.php")<-- (2) because semicolumn is missing here
    }<-- (1) Error is here
    
?>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900