dean012 Posted November 28, 2013 Share Posted November 28, 2013 <?php $name=$_POST['name']; $pass=$_POST['pass']; if ($name==('admin') & $pass==('123') ) { session_register['name']; session_register['pass']; header['location:admin.php']; } else echo 'something went wrong! Try again. Thanks.' ; ?> Quote Link to comment https://forums.phpfreaks.com/topic/284345-parse-error-syntax-error-unexpected-in-cusersuserlhtdocstestcheckphp-on-line-8/ Share on other sites More sharing options...
cyberRobot Posted November 28, 2013 Share Posted November 28, 2013 Change this header['location:admin.php']; To header('location:admin.php'); Quote Link to comment https://forums.phpfreaks.com/topic/284345-parse-error-syntax-error-unexpected-in-cusersuserlhtdocstestcheckphp-on-line-8/#findComment-1460447 Share on other sites More sharing options...
dean012 Posted November 28, 2013 Author Share Posted November 28, 2013 still the same prob Quote Link to comment https://forums.phpfreaks.com/topic/284345-parse-error-syntax-error-unexpected-in-cusersuserlhtdocstestcheckphp-on-line-8/#findComment-1460448 Share on other sites More sharing options...
dean012 Posted November 28, 2013 Author Share Posted November 28, 2013 Parse error: syntax error, unexpected '[' in C:\Users\User\l\htdocs\test\check.php on line 8 Quote Link to comment https://forums.phpfreaks.com/topic/284345-parse-error-syntax-error-unexpected-in-cusersuserlhtdocstestcheckphp-on-line-8/#findComment-1460449 Share on other sites More sharing options...
cyberRobot Posted November 28, 2013 Share Posted November 28, 2013 Is session_register a variable? If so, add a "$" before it. $session_register['name']; $session_register['pass']; Quote Link to comment https://forums.phpfreaks.com/topic/284345-parse-error-syntax-error-unexpected-in-cusersuserlhtdocstestcheckphp-on-line-8/#findComment-1460450 Share on other sites More sharing options...
dean012 Posted November 28, 2013 Author Share Posted November 28, 2013 Parse error: syntax error, unexpected '[' in C:\Users\User\l\htdocs\test\admin.php on line 5 <?php session_start() ; if (!$session_is_registered('pass')){ header['location:index.html']; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/284345-parse-error-syntax-error-unexpected-in-cusersuserlhtdocstestcheckphp-on-line-8/#findComment-1460457 Share on other sites More sharing options...
cyberRobot Posted November 28, 2013 Share Posted November 28, 2013 Parse error: syntax error, unexpected '[' in C:\Users\User\l\htdocs\test\admin.php on line 5 <?php session_start() ; if (!$session_is_registered('pass')){ header['location:index.html']; //<-- you're using square brackets } ?> See Reply 2 Quote Link to comment https://forums.phpfreaks.com/topic/284345-parse-error-syntax-error-unexpected-in-cusersuserlhtdocstestcheckphp-on-line-8/#findComment-1460518 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.