Professional Documents
Culture Documents
WBP Exp 11
WBP Exp 11
WBP Exp 11
Practical No 11:
Q. Write a Program to add hidden field, listbox, and combobox on webpage and display the values
entered and selected on the next page.
CODE:
index.php:
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$listBox = $_POST['listBox'];
$comboBox = $_POST['comboBox'];
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Page</title>
</head>
<body>
<h2>Form Page</h2>
<form action="index.php" method="post">
<input type="hidden" name="hiddenField" value="hiddenValue">
<label for="listBox">Listbox:</label>
<select id="listBox" name="listBox">
<option value="Java">Java</option>
<option value="C++">C++</option>
<option value="Python">Python</option>
</select><br><br>
<label for="comboBox">Combobox:</label>
<select id="comboBox" name="comboBox">
<option value="Frontend">Frontend</option>
<option value="Backend">Backend</option>
<option value="Full-Stack">Full-Stack</option>
</select><br><br>
<button type="submit">Submit</button>
</form>
</body>
</html>
Oaish Qazi 2|Page
OUTPUT: