Danny620 Posted August 11, 2009 Share Posted August 11, 2009 ok when i click submint i should see hq has been subminted but i am not for some resion <?php require('mysqli_connect.php'); require('buildinginprogress.php'); require('buildtime.php'); ?> <body> <form id="form1" name="form1" method="post" action=""> <table width="681" border="1"> <tr> <td width="96"><div align="center">Building</div></td> <td width="56"><div align="center">Level</div></td> <td width="80"><div align="center">Time</div></td> <td width="107"><div align="center">Cost</div></td> <td width="308"><div align="center">Upgrade</div></td> </tr> <tr> <td><div align="center">HQ</div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><label> <?php if(isset($_POST['hq'])){ $test = $_POST['hq']; echo $test; } ?> <div align="left"> <input type="radio" name="radio" id="hq" value="hq" /> hq </div> </label></td> </tr> <tr> <td><div align="center">WAREFARE</div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><label> <div align="left"> <input type="radio" name="radio" id="warfare" value="warfare" /> warfare</div> </label></td> </tr> <tr> <td><div align="center">TG</div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><label> <div align="left"> <input type="radio" name="radio" id="testing ground" value="testing ground" /> testing ground</div> </label></td> </tr> <tr> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="left"></div></td> </tr> <tr> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="left"></div></td> </tr> <tr> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="center"></div></td> <td><div align="left"> <label> <input type="submit" name="Upgrade" id="Upgrade" value="Upgrade" /> </label> </div></td> </tr> </table> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 11, 2009 Share Posted August 11, 2009 The name="..." attribute determines what is sent to the web server. Use the following code to see exactly what is in the $_POST array - <?php echo "<pre>"; echo "POST:"; print_r($_POST); echo "</pre>"; ?> Quote Link to comment Share on other sites More sharing options...
Danny620 Posted August 11, 2009 Author Share Posted August 11, 2009 i got POST:Array ( [radio] => hq [upgrade] => Upgrade ) Quote Link to comment Share on other sites More sharing options...
alexdemers Posted August 11, 2009 Share Posted August 11, 2009 Replace id="hq" with name="hq" on your input element. Only name+value combination gets sent to the server. Nothing else. Quote Link to comment Share on other sites More sharing options...
alexdemers Posted August 11, 2009 Share Posted August 11, 2009 ... or replace $_POST['hq'] with $_POST['radio'] Quote Link to comment Share on other sites More sharing options...
Danny620 Posted August 11, 2009 Author Share Posted August 11, 2009 thanks 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.