Create a PHP web script with the following attributes: on
start, three HTML form elements are shown: an string input
field, a checkbox field, a dropdown/pull down list with 5
elements and a submit button. On submission, the form
should be redisplayed (while remaining all options/inputs
as the user has selected/entered them). Additionally, the
selections/inputs of the user should be displayed in text.
Please solve this without the use of any external
libraries.
This is the Script:
<?php
if (isset($_POST["submit"]))
{
$textBox = $_POST["textBox"];
$dropdown = $_POST["dropdown"];
$check = $_POST["check"];
echo "Form submitted.";
}
else
{
echo "Please submit form";
}
?>
<form name="frm" method="post" action="<?php
$_SERVER["PHP_SELF"]?>" >
<input type="text" name="textBox" value="<?php echo
$textBox ?>" /><br />
<input type="checkbox" name="check" value="1" <?php if
($check == "1") echo "checked" ?> /><br />
<select name="dropdown">
<option <?php if ($dropdown == "Pankaj") echo "selected";
?> >Pankaj</option>
<option <?php if ($dropdown == "Bisane") echo "selected";
?> >Bisane</option>
<option <?php if ($dropdown == "MCS") echo "selected"; ?>
>MCS</option>
</select><br /><br />
<input type="submit" name="submit" value= "Submit" /><br />
</from>
| Is This Answer Correct ? | 17 Yes | 1 No |
How many Types of COmments are there in PHP and what are they?
How can image properties be retrieved in php?
What is use of htmlspecialchars php?
Tell me what sized websites have you worked on in the past?
What is difference between require_once(), require(), include()?
Tell me how can we get the error when there is a problem to upload a file?
What is $globals php?
What is the importance of "method" attribute in a html form?
What is mean by an associative array?
What is the difference between ereg_replace() and eregi_replace()?
What is The difference between ' and " where they can ben in between or outmost and how
What is the difference between explode() and split() functions?