Assignment: Set B Q.3 Solution

Write a PHP script to accept student name and list of programming languages (using drop down box) and display it on the next page in the proper format.

HTMl Form

                  <html>
  <body>
    <form action="php.php" method="post">
      <input type="text" name="sn" placeholder="Student name">
      <br><br>
      <select name="pl">
        <option>Select Programming languages</option>
        <option value="Java">Java</option>
        <option value="C">C</option>
        <option value="C++">C++</option>
        <option value="Javascript">Javascript</option>
      </select>
      <br><br>
      <input type="submit" >
    </form>
  </body>
</html>
    
        
    
        

PHP SCRIPT

                  <html>
<body>

<?php
  $sn=$_POST['sn'];
  $pl=$_POST['pl'];
?>

<h1>Student Name: <?php echo $sn;?></h1>
<h2>Preffered Language: <?php echo $pl;?></h2>
</body>
</html>