Hii, i am new here. I have an assignment and now i am confused so is here anyone who can helpp me. I have created the code lyk-
{<?php include 'header.php' ?>
<?php include 'connection.php'; ?>
<form name="f1" method="post" >
<b>COURSE:</b>
<select name="select" id="course">
<option value= "MCA" selected > MCA </option>
<option value= "MBA" > MBA </option>
<option value= "B.TECH" > B.TECH</option>
</select>
<b>SEMESTER:</b>
<select name="sem" >
<option value="">select</option>
<option value="1" >I</option>
<option value="2" >II</option>
<option value="3" >III</option>
<option value="4" >IV</option>
<option value="5" >V</option>
<option value="6" >VI</option>
</select>
<input type="submit" value="Click Here!!"/> </br>
</form>
<?php
if(isset($_POST['sem']))
{
$ans=$_POST['sem'];
if($ans=="1")
{
$result=mysql_query("select Name from subject_information where sub_code like 'CA- 1%'"); ?>
<form name="f2" method="post" action="">
Subject :<select name="sub" multiple="multiple">
<?php
while($row=mysql_fetch_array($result))
{
echo "<option value='".$row['Name']."'>".$row['Name']."</option>";
}
?>
</select>
<?php
}
elseif($ans=="2")
{
$result=mysql_query("select Name from subject_information where sub_code like 'CA- 2%'"); ?>
<form name="f3" method="post" action="">
Subject :<select name="sub" multiple="multiple">
<?php
while($row=mysql_fetch_array($result))
{
echo "<option value='".$row['Name']."'>".$row['Name']."</option>";
}?>
</select>
<?php
}
elseif($ans=="3")
{
$result=mysql_query("select Name from subject_information where sub_code like 'CA- 3%'"); ?>
<form name="f4" method="post" action="">
Subject :<select name="sub" multiple="multiple">
<?php
while($row=mysql_fetch_array($result))
{
echo "<option value='".$row['Name']."'>".$row['Name']."</option>";
}?>
</select>
<?php
}
elseif($ans=="4")
{
$result=mysql_query("select Name from subject_information where sub_code like 'CA- 4%'"); ?>
<form name="f5" method="post" action="">
Subject :<select name="sub" multiple="multiple">
<?php
while($row=mysql_fetch_array($result))
{
echo "<option value='".$row['Name']."'>".$row['Name']."</option>";
}?>
</select>
<?php
}
elseif($ans=="5")
{
$result=mysql_query("select Name from subject_information where sub_code like 'CA- 5%'"); ?>
<form name="f6" method="post" action="">
Subject :<select name="sub" multiple="multiple">
<?php
while($row=mysql_fetch_array($result))
{
echo "<option value='".$row['Name']."'>".$row['Name']."</option>";
}?>
</select>
<?php
}
elseif($ans=="6")
{
$result=mysql_query("select Name from subject_information where sub_code like 'CA- 6%'"); ?>
<form name="f7" method="post" action="">
Subject :<select name="sub" multiple="multiple">
<?php
while($row=mysql_fetch_array($result))
{
echo "<option value='".$row['Name']."'>".$row['Name']."</option>";
}?>
</select>
<?php
}
}
?>
<br>
<br>
<br>
<form name="a1" method="post" action="generate.php">
<input type="submit" value="GENERATE" style="font-size:18px;background-color:black;color:white" size="5" onClick="window.location.href='http://localhost/vishii/format.php' ">
</form>
<?php include 'footer.php' ?>
-