sloter Posted February 28, 2008 Share Posted February 28, 2008 In PHP how would I go about getting it to check to see if a use has selected an option from a drop down menu.Sample: <?php$select = htmlspecialchars($_POST['select']);if(!select == '') {echo 'Make a Selection';}else {echo 'Thank you for making a selection';}?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><select name="select"><option value='' selected>Select one...</option><option value='' selected>Option 1</option><option value='' selected>Option 2</option><option value='' selected>Option 3</option></select></form> Link to comment Share on other sites More sharing options...
sloter Posted February 28, 2008 Author Share Posted February 28, 2008 Bump Link to comment Share on other sites More sharing options...
djp1988 Posted February 28, 2008 Share Posted February 28, 2008 Don't you have to give each option a value? And removing the exclamation mark from before 'select' .... try it <?php$select = htmlspecialchars($_POST['select']);if(select == '') {echo 'Make a Selection';}else {echo 'Thank you for making a selection';}?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><select name="select"><option value='' selected>Select one...</option><option value='one' selected>Option 1</option><option value='two' selected>Option 2</option><option value='three' selected>Option 3</option></select></form> Link to comment Share on other sites More sharing options...
Synook Posted February 28, 2008 Share Posted February 28, 2008 <?php$select = htmlspecialchars($_POST['select']);if($select == 'Select one...') {echo 'Make a Selection';}else {echo 'Thank you for making a selection';}?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><select name="select"><option value='' selected>Select one...</option><option value='' selected>Option 1</option><option value='' selected>Option 2</option><option value='' selected>Option 3</option></select></form> Link to comment Share on other sites More sharing options...
jlhaslip Posted February 28, 2008 Share Posted February 28, 2008 <?php$select = htmlspecialchars($_POST['select']);if($select == 'Select one...') {echo 'Make a Selection';}else {... use php to handle selected value here ...echo 'Thank you for making a selection';}?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><select name="select"><option value='' selected>Select one...</option><option value='1' selected>Option 1</option><option value='2' selected>Option 2</option><option value='3' selected>Option 3</option></select></form> Link to comment Share on other sites More sharing options...
justsomeguy Posted February 28, 2008 Share Posted February 28, 2008 BumpDid you really bump this topic after 2 hours? This isn't your personal forum dude. Take a number. Link to comment Share on other sites More sharing options...
sloter Posted February 28, 2008 Author Share Posted February 28, 2008 Did you really bump this topic after 2 hours? This isn't your personal forum dude. Take a number.Must really want more post eh? Link to comment Share on other sites More sharing options...
justsomeguy Posted February 28, 2008 Share Posted February 28, 2008 You're exactly right. I live for my post count. I measure my life's worth by the number of posts I have here. In no way did I say that because I think you're being a jackass. It is purely based on post count. Good call! Welcome to the forum, please stay a while and let us know if there is anything at all that we can drop everything to help you with! In fact, the next time you have a question, just go ahead and send private messages to everyone. Also, please make sure you post the same question to every forum here. We love these things as much as people bumping their topics after 2 hours. Now excuse me while I go send you a request to be your friend. In addition to my post count, the second metric I use to measure my life's worth is how many online friends I have. Link to comment Share on other sites More sharing options...
sloter Posted February 29, 2008 Author Share Posted February 29, 2008 You're exactly right. I live for my post count. I measure my life's worth by the number of posts I have here. In no way did I say that because I think you're being a jackass. It is purely based on post count. Good call! Welcome to the forum, please stay a while and let us know if there is anything at all that we can drop everything to help you with! In fact, the next time you have a question, just go ahead and send private messages to everyone. Also, please make sure you post the same question to every forum here. We love these things as much as people bumping their topics after 2 hours. Now excuse me while I go send you a request to be your friend. In addition to my post count, the second metric I use to measure my life's worth is how many online friends I have.What online friends? Oh and yes and thanks for the offer for help! =) Link to comment Share on other sites More sharing options...
Synook Posted February 29, 2008 Share Posted February 29, 2008 What online friends?Well, in IPB you can add other users as your "friend", and then if they are online (i.e. active in the last 15 minutes), you have an online friend Link to comment Share on other sites More sharing options...
jlhaslip Posted March 2, 2008 Share Posted March 2, 2008 *bump*oh! *wait*... I can't bump this until I have friends... sorry. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.