20.
Write
PHP program to select list of subjects (use multivalued parameter) displays on
next page.
HTML File
<html>
<head><title>Slip20
</title>
</head>
<form action=slip20.php
method=get>
Select List of subjects
<select multiple
name="subjects[]">
<option
value="VB.NET">Vb.NET</option>
<option
value="PHP">PHP</option>
<option
value="JAVA">JAVA</option>
</select>
<input type=submit
value="submit">
</form>
</html>
PHP File
<?php
echo
"You selected subjects are";
echo "</br>";
foreach($_GET['subjects'] as $s)
{
echo
"$s</br>";
}
?>
When i run this program in xammp so tha PHP file is not working .i get error from foreach so plz tell me how to run this program
ReplyDeleteg
can u send the screenshot of error ??
Deleteabove code is working and tested.