-1

what's wrong with this code i'm getting the error UNEXPECTED T_STRING.. on line 7

if(!$query) 
{
    die("Unable to enter into database");
}
elseif

    header("location:/Peach Mansions/confirm.php");

}
else
{
echo 'a required field is missing'; 
}

?>

hakre
  • 193,403
  • 52
  • 435
  • 836
  • elseif which condition? – bwoebi Jul 22 '13 at 11:21
  • 1
    `elseif` should be `elseif(condition)`. – Yogesh Suthar Jul 22 '13 at 11:24
  • you are also missing a opening tag "{" after the elseif – cptnk Jul 22 '13 at 11:25
  • The error tells you what is wrong. If you have problems to understand the error message, please see the error reference we've got, it's one of the more useful resources about such errors: [Reference - What does this error mean in PHP?](http://stackoverflow.com/q/12769982/367456) – hakre Jul 22 '13 at 11:27

2 Answers2

3
elseif

    header("location:/Peach Mansions/confirm.php");

}

should be

elseif (YOUR_CONDITION) {

    header("location:/Peach Mansions/confirm.php");

}
Goutam Pal
  • 1,763
  • 1
  • 10
  • 14
0

You miss { and condition after elseif.

elseif (condition) {
Bere
  • 1,627
  • 2
  • 16
  • 22