ki Posted February 28, 2007 Share Posted February 28, 2007 Okay im setting up a user avatar thing for my site kinda like how this one is. How does php react to choices? I use isset(empty(!$_POST['check'])) to check is check box is checked, idk if its the same format or not? Any help? Quote Link to comment Share on other sites More sharing options...
itsmeArry Posted February 28, 2007 Share Posted February 28, 2007 if a checkbox is checked then only you will get the value for that check box in POST array otherwise you will not find it in POST array so you can check this..... if(isset($_POST['check'])) this will do... Quote Link to comment Share on other sites More sharing options...
monk.e.boy Posted February 28, 2007 Share Posted February 28, 2007 do a: print_r( $_POST); to see what you are getting. Take (or comment) out this line when you are ready to go live. monk.e.boy Quote Link to comment Share on other sites More sharing options...
ki Posted February 28, 2007 Author Share Posted February 28, 2007 No I used that for my check box im talking about an Option button Quote Link to comment Share on other sites More sharing options...
willpower Posted February 28, 2007 Share Posted February 28, 2007 Your html form will have an id/name value attached to the select...or at least it should have. <select name="mynameforthisselect"> Now to get the values you simpley use if (isset($selectvalue=$_POST['mynameforthisselect']) { //do this } else { //do that } Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted February 28, 2007 Share Posted February 28, 2007 i would use radio buttons, not a dropdown menu. Quote Link to comment Share on other sites More sharing options...
ki Posted February 28, 2007 Author Share Posted February 28, 2007 bah im sorry thats what i mean, radio buttons, I really never knew the name but it just now sparked in my head Quote Link to comment Share on other sites More sharing options...
willpower Posted February 28, 2007 Share Posted February 28, 2007 the same rule applys. you should have a name for your radio group. ie <input type="radio" name="radioGroup1" value="option1" /> <input type="radio" name="radioGroup1" value="option2" /> <input type="radio" name="radioGroup1" value="option3" /> PHP if (isset($selectvalue=$_POST['radioGroup1']) { echo $_POST['radioGroup1']; } else { //do that } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.