Registration form - 1

Discussion in 'PHP' started by moin, Apr 20, 2007.

  1. #1
    I have used this form for course registration,

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="">
      <META NAME="Keywords" CONTENT="">
      <META NAME="Description" CONTENT="">
     </HEAD>
    
     <BODY>
     <form name="mainform" method="post" action="test_3.php">
    <select name="course" onchange="document.mainform.c_date.value = this.value">
        <option value="12-01-2007">.NET</option>
        <option value="13-01-2007">J2ee</option>
        <option value="14-01-2007">PHP</option></select>
    <input type="text" name="c_date" />
    <input type="submit" value="submit"/>
    </form>
     </BODY>
    </HTML>
    Code (markup):
    But the main problem is, when I am trying to display the details, i.e course and details from the database only date is displayed but not the course, here is the code for it,

    `<?php
    $con = mysql_connect("localhost","root","");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }mysql_select_db("my_student5", $con);$result = mysql_query("SELECT * FROM person");
      
    echo "<table border='1'>";
      while($row = mysql_fetch_array($result, MYSQL_NUM))
      {
      echo "<tr><td>$row[0]</td><td>$row[1]</td></tr>";
      
      }echo "</table>";
      mysql_close($con);
    ?>
    
    Code (markup):
    if we are using, <select name="course">
    <option value="12-01-12">.NET</option>
    </option>

    Only the date is displayed but not the course.

    how to rectify that.

    Any help
     
    moin, Apr 20, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nico_swd, Apr 20, 2007 IP