Jump to content

[SOLVED] radio buttons


Lambneck

Recommended Posts

This form is sending the wrong info to database.

When selecting the specific country (America, Canada, or Britain)

it shows up in the database as "country".

 

$country = $_POST['country'];

 

<INPUT TYPE="radio" Name="country" VALUE="America">America<br>
<INPUT TYPE="radio" Name="country" VALUE="Canada">Canada<br>
<INPUT TYPE="radio" Name="country" VALUE="Britain">Britain<br>

 

What am I doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/121757-solved-radio-buttons/
Share on other sites

mysql_query("INSERT INTO $table (col_1, col_2, col_3, col_4, col_5, col_6, col_7, col_8, col_9, col_10, col_11, col_12, col_13, submission_date, ip_address) VALUES ('country', '$compname', '$compadd', '$billname', '$billadd','$phone','$email','$cardnum','$cardtype','$cardexp','$instructions','$subject','$message', '$submission_date','$ip')")or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/121757-solved-radio-buttons/#findComment-628123
Share on other sites

fixed missing dollar sign:

mysql_query("INSERT INTO $table (col_1, col_2, col_3, col_4, col_5, col_6, col_7, col_8, col_9, col_10, col_11, col_12, col_13, submission_date, ip_address) VALUES ('$country', '$compname', '$compadd', '$billname', '$billadd','$phone','$email','$cardnum','$cardtype','$cardexp','$instructions','$subject','$message', '$submission_date','$ip')")or die(mysql_error());

 

Link to comment
https://forums.phpfreaks.com/topic/121757-solved-radio-buttons/#findComment-628125
Share on other sites

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.