Click here to Skip to main content
14,356,576 members
Rate this:
Please Sign up or sign in to 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:

<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 11: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
Rate this:
Please Sign up or sign in to vote.

Solution 1

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



<pre><?php
					session_start();
					if(!session_is_registered("username"))
					{
						header("location:login_user.php")
					}<--which is this right here
			
			?>
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

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

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100