can i check is there any wrong with this?
it prompted me error in line 5
Parse error: syntax error, unexpected T_IF

<?php 
session_start()
if (!(isset($_SESSION['email']) && $_SESSION['email'] != '')) {
header ("Location: login.php");
}

Firstly, the line number mentioned in the error message is just where you start looking for a problem. You then work BACKWARDS through your script. The error message is saying it found an unexpected IF statement. This means the error is just before the IF statement. Look closely at the line above it (line 2 in this case).

Member Avatar

diafol

Yes have a look at the end of line 2. It's missing something.

you forgot a semi-colon on line 2

session_start();
Member Avatar

diafol

... there was always gonna be one... :)

@ardav he never marked it as "Solved", so I figure the person was too lazy to solve your riddle. Stupid semi-colons!

@ardav he never marked it as "Solved", so I figure the person was too lazy to solve your riddle. Stupid semi-colons!

thanks! so careless of me.. thanks everyone here..