Jump to content

PYRRHIC

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PYRRHIC's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks for your reply. although the undefined message is no longer appearing the result has not change, doesnt seem recognize the the radio names avatar_color.
  2. tried changing method to post and using $_GET[avatar_color] way no luck <form action="" method="post"><div id="avatar_section"> <div id="avatar_stack"> <p> <img src="herotmb/face0.png" alt="" /><input name="avatar_head" type="radio" value="face0" checked="checked" /> </p> <p> <img src="herotmb/face.png" alt="" /><input type="radio" name="avatar_face" value="face0" /> <img src="herotmb/face1.png" alt="" /><input name="avatar_face" type="radio" value="face1" /> <img src="herotmb/face2.png" alt="" /><input name="avatar_face" type="radio" value="face2" /> <img src="herotmb/face3.png" alt="" /><input name="avatar_face" type="radio" value="face3" /> </p> <p> <img src="herotmb/color0.png" alt="" /><input type="radio" name="avatar_color" value="black" id="black" /> <img src="herotmb/color1.png" alt="" /><input type="radio" name="avatar_color" value="brown" id="brown" onclick="color(brown);" /> <img src="herotmb/color2.png" alt="" /><input type="radio" name="avatar_color" value="darkbrown" id="darkbrown" onclick="color(darkbrown);" /> <img src="herotmb/color3.png" alt="" /><input type="radio" name="avatar_color" value="yellow" id="red" onclick="color(red);" /> <img src="herotmb/color4.png" alt="" /><input type="radio" name="avatar_color" value="red" id="yellow" onclick="color(yellow);" /> </p> <?php $selected_radio = $_GET['avatar_color']; ---line102----- if ($selected_radio == 'black') { echo ' <p> <img src="herotmb/hair0-black.png" alt="" /><input name="avatar_hair" type="radio" value="hair0-black" /> <img src="herotmb/hair1-black.png" alt="" /><input name="avatar_hair" type="radio" value="hair1-black" /> <img src="herotmb/hair2-black.png" alt="" /><input name="avatar_hair" type="radio" value="hair2-black" /> <img src="herotmb/hair3-black.png" alt="" /><input name="avatar_hair" type="radio" value="hair3-black" /> <img src="herotmb/hair4-black.png" alt="" /><input name="avatar_hair" type="radio" value="hair4-black" /> <img src="herotmb/hair5-black.png" alt="" /><input name="avatar_hair" type="radio" value="hair5-black" /> <img src="herotmb/hair6-black.png" alt="" /><input name="avatar_hair" type="radio" value="hair6-black" /> <img src="herotmb/hairNone-black.png" alt="" /><input name="avatar_hair" type="radio" value="hairNone" /> </p>'; } else if ($selected_radio == 'brown') { echo ' <p> <img src="herotmb/hair0-brown.png" alt="" /><input name="avatar_hair" type="radio" value="hair0-brown" /> <img src="herotmb/hair1-brown.png" alt="" /><input name="avatar_hair" type="radio" value="hair1-brown" /> <img src="herotmb/hair2-brown.png" alt="" /><input name="avatar_hair" type="radio" value="hair2-brown" /> <img src="herotmb/hair3-brown.png" alt="" /><input name="avatar_hair" type="radio" value="hair3-brown" /> <img src="herotmb/hair4-brown.png" alt="" /><input name="avatar_hair" type="radio" value="hair4-brown" /> <img src="herotmb/hair4-brown.png" alt="" /><input name="avatar_hair" type="radio" value="hair4-brown" /> <img src="herotmb/hairNone-brown.png" alt="" /><input name="avatar_hair" type="radio" value="hairNone" /> </p>'; } else if ($selected_radio == 'darkbrown') { echo 'Table 3 Here.'; } Notice: Undefined index: avatar_color in index20.php on line 102 (yes this is attempt 20) Trying to make an array as you suggested, how does this look $array = array('color'=> 'black','brown','darkbrown','red','yellow'); echo ' <p> <img src="herotmb/$array.png" alt="" /><input type="radio" name="avatar_color" value="$array" id="$array" />'; </p>';
  3. ok thanks for your input. Since Im getting "Undefined index: avatar", even in array the problem still wouldn't be solved, would it I've even removed the extra brackets, now its avatar_color. would I be trying to make the array for both the avatar_color and avatar_hair or just one of the sections?
  4. I will keep that in mind, thanks I added error_reporting and now I am getting an error line 113 112 $selected_radio = $_POST["avatar[color]"]; 113 if ($selected_radio == "black") { 114 echo ' when I change == to != the info shows up but does not switch to (Table 2 here) so I am assuming, and correct me if Im wrong, that the value from selected_radio is not being recognized. how would I fix this ?
  5. wow, didn't know this was moved thought it got deleted and almost posted it again. good thing I was searching and thanks for just moving it Thanks for the replies, no I am not getting an error messages the tab info is just not showing. I tried $selected_radio = $_POST['avatar']['color']; but the tab info is now being skip. what I mean by that is the info from 2 tabs down is showing in its place. any other suggestions. I can post the JS info which is making the tabs if need be. thanks in advance
  6. I have been searching for something like this to use so I am trying to implement these ideas for my form but unable to get it to work. The concept is similar so I am posting here but if I would make a new post just let me know. it is not posting the info when the radio button is checked. Someone with a keener eye that mine can give a look and tell what I have done incorrectly it would be appreciated. echo ' <form action="" method="get"><div id="avatar_section"> <div id="avatar_stack"> <p> <img src="herotmb/face0.png" alt="" /><input name="avatar[head]" type="radio" value="face0" checked="checked" /> </p> <p> <img src="herotmb/face0.png" alt="" /><input type="radio" name="avatar[face]" value="face0" /> <img src="herotmb/face1.png" alt="" /><input type="radio" name="avatar[face]" value="face1" /> <img src="herotmb/face2.png" alt="" /><input type="radio" name="avatar[face]" value="face2" /> <img src="herotmb/face3.png" alt="" /><input type="radio" name="avatar[face]" value="face3" /> </p> <span name="color"> <p> <img src="herotmb/color0.png" alt="" /><input type="radio" name="avatar[color]" value="black" id="black" onclick="color(black);" /> <img src="herotmb/color1.png" alt="" /><input type="radio" name="avatar[color]" value="brown" id="brown" /> <img src="herotmb/color2.png" alt="" /><input type="radio" name="avatar[color]" value="darkbrown" id="darkbrown" onclick="color(darkbrown);" /> <img src="herotmb/color3.png" alt="" /><input type="radio" name="avatar[color]" value="yellow" id="red" onclick="color(red);" /> <img src="herotmb/color4.png" alt="" /><input type="radio" name="avatar[color]" value="red" id="yellow" onclick="color(yellow);" /> </p> </span> '; $selected_radio = '$_POST[avatar[color]]'; if ($selected_radio == 'black') { echo ' <p> <img src="herotmb/hair0-black.png" alt="" /><input name="avatar[hair]" type="radio" value="hair0-black" /> <img src="herotmb/hair1-black.png" alt="" /><input name="avatar[hair]" type="radio" value="hair1-black" /> <img src="herotmb/hair2-black.png" alt="" /><input name="avatar[hair]" type="radio" value="hair2-black" /> <img src="herotmb/hair3-black.png" alt="" /><input name="avatar[hair]" type="radio" value="hair3-black" /> <img src="herotmb/hair4-black.png" alt="" /><input name="avatar[hair]" type="radio" value="hair4-black" /> <img src="herotmb/hair5-black.png" alt="" /><input name="avatar[hair]" type="radio" value="hair5-black" /> <img src="herotmb/hair6-black.png" alt="" /><input name="avatar[hair]" type="radio" value="hair6-black" /> <img src="herotmb/hairNone-black.png" alt="" /><input name="avatar[hair]" type="radio" value="hairNone" /> </p>'; } else if ($selected_radio == 'brown') { echo 'Table 2 Here.'; } else if ($selected_radio == 'darkbrown') { echo 'Table 3 Here.'; } else if ($selected_radio == 'red') { echo 'Table 4 Here.'; } else if ($selected_radio == 'yellow') { echo 'Table 5 Here.'; } echo ' <p id="submit" > <input type="submit" value="Save" /> </p> </form>';
  7. Hi. I'm from L.A. but have been living in Tokyo for so time now. I have 2 certs and will be going for CCNA this summer and pursuing a position with the DOD. long term goal is to get CEH. Im new at php and will be trying it in my spare time. I joined this website in the hope that if I get stuck one of you lovely people will help me or once I get a grasp of PHP I will try to help some peeps myself. So anyways... HI!
×
×
  • 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.