mercredi 7 décembre 2016

PHP : Parse error: syntax error, unexpected 'if' (T_IF) [duplicate]

This question already has an answer here:

Hey I want to make a new website , but i'm getting an error :


Parse error: syntax error, unexpected 'if' (T_IF) (Line 3 in Code 2)


My Code :


Site 1:

<?php
  $benutzername = $_POST['benutzername'];        //Getting information from an other site
  $passwort = $_POST['passwort'];

  if ($benutzername == "Test" && $passwort == "Lol") {
    session_start();
    $_SESSION['infos'] = True;
    header ('Location: infos.php');
  }
  else {
    echo "Benutzername und/oder Passwort falsch :/";
  }
?>


Site 2

<?php
  session_start()
  if (!isset($_SESSION['infos'])) {     //It say here is my error
      header('Location: index.html');
  }

?>
<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="style.css">
    <meta charset="utf-8">
    <title>Die Olzigen 721 » Infos</title>
    <title></title>
  </head>
  <body>
    <h1>Test</h1>
  </body>
</html>




Aucun commentaire:

Enregistrer un commentaire