Jump to content

Parse error: syntax error, unexpected '[' in C:\Users\User\l\htdocs\test\check.php on line 8


dean012

Recommended Posts


<?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.' ;

?>

 

Parse errorsyntaxarrow-10x10.png error, unexpected '[' in C:\Users\User\l\htdocs\test\adminarrow-10x10.png.php on linearrow-10x10.png 5

<?php
session_start() ;
if (!$session_is_registered('pass')){

	header['location:index.html'];  //<-- you're using square brackets
}


?>

 

 

See Reply 2

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.