How could I stop PHP from displaying the error?

WarDemon666

Platinum Member
Nov 28, 2000
2,224
0
0
This is the script, it searches for the cookie, if its not there, then it says warning, loggedin is not defined. Is there a way that if the cookie is not there, that it will just show the html and nothing else?

Thanks,
Wardemon

<?
if($loggedin) {
header("location: logged.php");
}
?>
<html>
<body>
This is the main html page
</body>
</html>
 

MereMortal

Golden Member
Oct 16, 2000
1,919
2
81
You can use the '@' symbol before an expression to suppress error messages caused by that expression.

In this case you can use if(@$loggedin) ...
 

WarDemon666

Platinum Member
Nov 28, 2000
2,224
0
0
Thanks!!

one more question, if i put an echo with a link, i get a parse error, what am i doing wrong? heres what it looks like:

echo "Thanks for logging in.";
echo "You can login to a web ftp client. Here is the URL: <a href="http://www.link.com">link</a>";
echo "Soon there will be access to your account with our own FPT client. Stay tuned.";

i get this error: Parse error: parse error, expecting `','' or `';''

Any ideas?

Thanks

 

WarDemon666

Platinum Member
Nov 28, 2000
2,224
0
0
Could you explain the escape characters a bit further? I dont know where to put them.

Thanks.
 

RSMemphis

Golden Member
Oct 6, 2001
1,521
0
0
Wrong:
echo "You can login to a web ftp client. Here is the URL: <a href="http://www.link.com">link</a>";

Right:

echo "You can login to a web ftp client. Here is the URL: <a href=\"http://www.link.com\">link</a>";

or

echo "You can login to a web ftp client. Here is the URL: <a href='http://www.link.com'>link</a>";