livewirerules Posted July 29, 2008 Share Posted July 29, 2008 when i submit my form, the values in the drop down list does not go to the database This is my form <FORM name="comb" method="post" action="esa.php"> <table border=4> <tr> <td> <div align="center"> <INPUT name="combi" TYPE="text" Size="20" maxlength="5"> <br> </div></td> </tr> <tr> <td> <div align="center"> <input type="button" name="one" value=" 1 " OnClick="comb.combi.value += '1'"> <input type="button" name="two" value=" 2 " OnCLick="comb.combi.value += '2'"> <input type="button" name="three" value=" 3 " OnClick="comb.combi.value += '3'"> <br> <input type="button" name="four" value=" 4 " OnClick="comb.combi.value += '4'"> <input type="button" name="five" value=" 5 " OnCLick="comb.combi.value += '5'"> <input type="button" name="six" value=" 6 " OnClick="comb.combi.value += '6'"> <br> <input type="button" name="seven" value=" 7 " OnClick="comb.combi.value += '7'"> <input type="button" name="eight" value=" 8 " OnCLick="comb.combi.value += '8'"> <input type="button" name="nine" value=" 9 " OnClick="comb.combi.value += '9'"> <br> </div></td> </tr> </table> <p>Select :</span> <select name="skey" onChange="showimage()"> <option selected value="images/1.gif">Key 1</option> <option value="images/2.gif">Key 2</option> <option value="images/3.gif">Key 3</option> </select> <img src="images/1.gif" name="pictures" width="60" height="73"> </p> <p><strong>mime <input name="mime" type="text" /> </span></p> <p> <input name="submit" type="submit" value="submit" /> </p> </FORM> this is my php code <?php if ($_POST['submit']) { $skycod=$_POST['combi']; $skey=$_POST['skey']; $mime=$_POST['mime']; $today = date("F j, Y, g:i a"); $sql="insert into `safegame_esafe_results` set gdate='$today', mime='$mime', rkycod='$rkycod', rkey='$rkey', skycod='$skycod', skey='$skey'"; $result = mysql_query($sql) or die(mysql_error()); } ?> The $skey value does not go to the database. Any help will be appreciated Link to comment https://forums.phpfreaks.com/topic/117216-values-not-passing-in-form/ Share on other sites More sharing options...
Attila Posted July 29, 2008 Share Posted July 29, 2008 Try this with your form: <form method="post" action="$_SERVER[php_SELF]"> Link to comment https://forums.phpfreaks.com/topic/117216-values-not-passing-in-form/#findComment-602974 Share on other sites More sharing options...
gabarab Posted July 29, 2008 Share Posted July 29, 2008 The values pass with ease.... so the problem is not the form, but your php code. I see that you have slashes into your skey variable. try saving only 1.gif, 2.gif..and so on and simply add the "image/" in the code that will show the image, but not into the database... this is the simplest method i could think... i am sure there are others also... Link to comment https://forums.phpfreaks.com/topic/117216-values-not-passing-in-form/#findComment-602991 Share on other sites More sharing options...
livewirerules Posted July 29, 2008 Author Share Posted July 29, 2008 The values pass with ease.... so the problem is not the form, but your php code. I see that you have slashes into your skey variable. try saving only 1.gif, 2.gif..and so on and simply add the "image/" in the code that will show the image, but not into the database... this is the simplest method i could think... i am sure there are others also... Right... I didnt notice that..Thanks Link to comment https://forums.phpfreaks.com/topic/117216-values-not-passing-in-form/#findComment-602994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.