Here is what I would like to do;
I have a form, which users have to select either colour red or colour blue.
Depending on which the click, on submit I want to take these results, assign a value to them and add that value to a table in my database........... I don't really know how to start.
So far I have got;
1) code for radio buttons on form
...........
<TD WIDTH="50%" HEIGHT="61"> <P>
<FONT FACE="Arial, Helvetica, sans-serif">Colour Red
</FONT></P>
<P><FONT FACE="Arial, Helvetica, sans-serif">Colour Blue </FONT></P></TD>
<TD WIDTH="50%"><P>
<INPUT TYPE="radio" NAME="Colour" VALUE="red" checked> </P>
<P> <INPUT TYPE="radio" NAME="Colour" VALUE="blue">
</P></TD></TR>
</TABLE>
<P ALIGN="CENTER"><INPUT TYPE="submit" NAME="Submit" VALUE="Submit"></P></FORM>
2) code in separate file (process_form.php) to take process results
IF ($_POST[Colour] == red)
{$Colour == 3};
ELSE
{$Colour == 1};
$sql = "INSERT INTO tblMachine (Colour) VALUES ('$Colour')";
$result = @mysql_query($sql)
or die(mysql_error());
from this I am getting a parse error on the IF / ELSE code, so I know this isn't constructed correctly, but I don't know how to correct it.......
The form does not have to have radio buttons, it can be tick boxes if this is easier to construct, I just need to process the results into the database..........
thanks