Jump to content

Drop-Down Menu PHP Form Handler


DanFTW

Recommended Posts

I want to know how to set up my form handler on the PHP script to get it to work, i'm pretty sure I know the html part.

 

ex.

 

do I go

<?PHP echo "blahblahblah " . "$whathere??? '' . "blahahahaha" ?>

 

yeah anyways.

Link to comment
Share on other sites

I'm not sure you've explained what it is you're trying to do, but I'll take a guess.

 

You have a form with a select named wombat and when the form data are sent to form-handler.php you want to display the selected value of the variable named wombat.

 

Assuming your form method is post ...

 

<?php
// form-handler.php
$wombat = $_POST['wombat']; // retrieved POSTed data
echo "You chose ". $wombat; // display chosen value
?>

Link to comment
Share on other sites

<html><body>
<form action="form-handler.php" method="post">
Pick a thing
<select name="wombat">
<option value="apple">apple</option>
<option value="pear">pear</option>
</select>
<input type="submit" value="go"/>
</form>
</body></html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.