如何摆脱这个错误? [英] How to get rid of this error?

查看:64
本文介绍了如何摆脱这个错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


在这个项目上工作,我现在正在尝试在用户登录时验证用户并登录它,它应该将用户带到欢迎的后页但我是严重得到错误,想知道如何解决它。



这是我的尝试。



我尝试过:



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>



?>














?>

















Browse National Wonders
Update Profile
Post Natural Wonders
Logout












推荐答案

_SESSION [' username'];
?>





< div id = footerbox >

< div id = footerholder >
< div id = < span class =code-keyword> >

< a href = browsenationalwonders.php > 浏览国家奇迹< / a >
< a href = updateprofile.php > 更新资料< / a >
< a href = postnaturalwonder.php > Post Natural Wonders < / a >
< a href = logout.php > 退出< / a >



< / div >

< / div >
< / div >
< / div >

< / body >

< / html >
_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>



?>














?>

















Browse National Wonders
Update Profile
Post Natural Wonders
Logout













错误是:
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
			
			?>


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


这篇关于如何摆脱这个错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆