Jump to content

Values not passing in form


livewirerules

Recommended Posts

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

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...

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 ;D

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.