0

Im learning PHP and i got stuck on a problem I made a page where it has a field to insert an answer so you can go to the next page and get the answer; But php only returns a blank page. Here it the index.html code:

<html>
<head>
<style>
body{background-color:#0288D1;}
</style>
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.1/css/materialize.min.css">

  <!-- Compiled and minified JavaScript -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.1/js/materialize.min.js"></script>

<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
      <!--Import materialize.css-->
      <link type="text/css" rel="stylesheet" href="css/materialize.min.css"  media="screen,projection"/>

      <!--Let browser know website is optimized for mobile-->
      <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<h1 style="text-align: center;"><span style="font-family:trebuchet ms,helvetica,sans-serif;">What is Watch Dogs ?</span></h1>


    <form class="col s12"  action="form.php" method="post">
          <input name='answer'>Answer here</input>
          </form>



  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
      <script type="text/javascript" src="js/materialize.min.js"></script>
</body>
</html>

And here is the form.php code

<?php
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);
?>
<html>
<body>

<?php
    $answer = $_POST['answer'];

if($odgovor == "Game"){
echo "<p>Correct visit this link to answer the second question: www.something.something.com</p>"
}
else{
echo "<p>*Insert Nelson's Laugh here* You answered wrong</p>"
}

?>

    </body>
</html>
MatejMecka
  • 1,448
  • 2
  • 24
  • 37

0 Answers0