PHP如果... ...其他语句返回错误
问题描述:
下面是我的代码PHP如果... ...其他语句返回错误
<?php
//Vars
$alreadylogged = 0;
$username = 0;
//End Var
//Start Script
print 'Welcome to CraftedList!</br>'
if ($alreadylogged=="1") *Side note, this line is line 34*
{
print 'You are currently logged in as'. $username .'!';
}
else
{
print 'You are not logged in!'
}
?>
但是,当我执行它本地主机XAMPP客户端上,它返回此错误。
Parse error: syntax error, unexpected 'if' (T_IF) in C:\xampp\htdocs\phptest\index.php on line 34
我检查了W3学校,我的代码与他们的类似。
答
失踪;
这里:
print 'Welcome to CraftedList!</br>'
这里:
print 'You are not logged in!'
速度越快停止使用W3Schools的的更好,你会没事的。 – GordonsBeard 2013-02-27 01:30:52