dimanche 16 septembre 2018

If statement in php not closing? [duplicate]

Error: Unexpected } ,Please Help! it doesn't seem to work. Here is my code snippet.

if (isset($_GET['search']))

  {

  $get_value = $_GET['user_query'];
    echo "<div class='result'>
            $get_value
    </div>"

  }

Here is the whole code.

<!DOCTYPE html>
<html>
  <head>
  <title>Result page</title>


  <style type="text/css">
  .result {margin: 5%;}
  </style>
  </head>
<body bgcolor="#F5DEB3">
<form action="result.php" method="get">

    <span><b>Write your keyword:</b></span>
    <input type="text" name="user_keyword" size="120" />

    <input type="submit" name="result" value="Search Now"/>


</form>
<?php

if (isset($_GET['search']))

  {

  $get_value = $_GET['user_query'];
    echo "<div class='result'>
            $get_value
    </div>"

  }


?>




</body>
</html>

Aucun commentaire:

Enregistrer un commentaire