Jump to content

Recommended Posts

Hi guys, i just want to know if this is possible, or if any one has a simple solution.....

 

ok, iv got a form with a drop down box which has three values

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<select>
  <option>Heavy training with emphasis on strength and stamina</option>
  <option>Medium training with emphasis on fast paced attacking football</option>
  <option>Light training focused on quick passing and set piece play</option>
</select>
<input type="submit" value="Begin Training Session" />
</form>

 

Say the user selects "Heavy training with emphasis on strength and stamina".....

is there any way of inserting a "1" into a database table and so on for the others???

 

Anyone know if its possible ???

 

thanks in advance

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/36764-solved-drop-down-boxes/
Share on other sites

hmmmm so I have

 

<select>

  <option value="1">Heavy training with emphasis on strength and stamina</option>

  <option value="2">Medium training with emphasis on fast paced attacking football</option>

  <option value="3">Light training focused on quick passing and set piece play</option>

</select>

 

but then how would I implement if(isset statements to insert the values into my DB???

 

Il have a look on the net but if anyone knows please reply!!!

 

cheers

<?php 
if(isset($_POST['submit'])){
$type = $_POST['type'];

//...mysql insert or whatever you want...
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<select name="type">
 <option>Heavy training with emphasis on strength and stamina</option>
 <option>Medium training with emphasis on fast paced attacking football</option>
 <option>Light training focused on quick passing and set piece play</option>
</select>
<input type="submit" name="submit" value="Begin Training Session" />
</form>

I think thats basically it.

Ted

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.