Jump to content

$_post Help


regieferg
 Share

Recommended Posts

i am JUST learning phpi want to get the values of dropdown menu to show on regular page

<html><body>#Equipment pack<?php echo $_POST["wepon 1"]; ?><br /><?php echo $_POST["wepon 2"]; ?><br /><?php echo $_POST["fname"]; ?><form action="http://theelitehackers.com/index.php?pageid=cg" method="post"><select name="wepon 1"><option value="0x004294F4 0x000000">Blaster Rifle</option><option value="0x004294F4 0x00000002">Arc Caster</option><option value="0x004294F4 0x00000003">Carbon Frze Gun</option></select><select name="wepon 2"><option value="tri shot">tri shot</option><option value="0x004294F8 0x00000003">emp</option></select><input type="submit" />Name: <input type="text" name="fname" /></form></body></html>

it shows the name but not the options like:#Equipment pack(name)i want the values to show:#Equipment pack(values)(values)(name)

Link to comment
Share on other sites

Try writing <?php echo "#Equipment Pack"; ?> instead of #Equipment Pack. This is what you're trying to accomplish, right?#Equipment PackBlaster RifleTri shotBut you getBlaster RifleTri shotRight?

Edited by 23.12.2012
Link to comment
Share on other sites

#Equipment pack<?php echo $_POST["wepon 1"]; ?><br /><?php echo $_POST["wepon 2"]; ?><br /><?php echo $_POST["fname"]; ?>

If you haven't submitted the form, these values are going to be empty, and if you have warnings activated, it would tell you that $_POST['wepon1'] is not defined.If you're asking what I think you're asking, the page isn't going to update the moment you select something from the dropdown list. You have to submit the form.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...