Drezard Posted September 16, 2006 Share Posted September 16, 2006 Heres the error:[QUOTE]Parse error: syntax error, unexpected ';' in C:\Program Files\xampp\htdocs\login_sucess.php on line 3[/QUOTE]Heres my code:[CODE]<?phpif (isset($_SESSION['userinfo']{session_start();$user = $_SESSION['userinfo'];setcookie('user', $user, time()+36000*24*365);session_destroy();}?><head></head><body><?phpif (isset($_COOKIE['user'])) {echo "Login Complete, Welcome $user";}if (!isset($_SESSION['userinfo'] (?> <meta http-equiv="refresh" content="0;url=login_form.php">;<?php }?></body></html>[/CODE]Whats wrong with this code?- Cheers, Daniel Quote Link to comment Share on other sites More sharing options...
tomfmason Posted September 17, 2006 Share Posted September 17, 2006 You should always place you session_start(); before anything else. So this is what it should look like.[code=php:0]<?phpsession_start();if (isset($_SESSION['userinfo'])) { //this is were you missed two ))[/code]Hope this helps,Tom Quote Link to comment Share on other sites More sharing options...
Drezard Posted September 17, 2006 Author Share Posted September 17, 2006 Forgot that rule.Thanks, Daniel Quote Link to comment Share on other sites More sharing options...
imartin Posted September 17, 2006 Share Posted September 17, 2006 there may be times when Session_start(); wont be the very first bit of code, the important thing is that it comes before anything that will be printed to the file after processing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.