Hi,
I am having trouble getting this to work....here is the code below....it suppose to be a event driven code....the table(userProfile) is already created.....when you click the first radio button it pushes 1 into the table or else it pushes 2 into the table. But, for some reason the (if...else) structure is failing or it 3:00am in the morning and I am not seeing it.
<?php
/ Connecting, selecting database /
$link = mysql_connect(localhost , team03 , team03) or die("Could not connect");
mysql_select_db(newsreader) or die("Could not select database");
?>
<form name = "form" method="POST">
<td><font class="smallblue">Select News Type:</td> // below is where the radio buttons are being created, the name have to be the same
<td align=center width=10%><font class=medblue><input type=radio class=schedule name="R1" value="International News"><br>International News</td>
<td align=center width=10%><font class=medblue><input type=radio class=schedule name="R1" value="Sports News"><br>Sports News</td>
<script language = "javascript">
<!--
function save()
{
if (document.form.R1[0].checked) //test to see if the first radio button is clicked
{
alert("You have selected to receive International News on your PDA");
<?php
mysql_query("DELETE FROM userProfile"); // I am doing this b/c I want to remove the row, so that it will always be 1 row and not grow
$query = "INSERT INTO userProfile (choice) VALUES ('1')";
$result = mysql_query($query, $link);
?>
}
else
{
alert("You have selected to receive Sports News on your PDA");
<?php
mysql_query("DELETE FROM userProfile"); // I am doing this b/c I want to remove the row, so that it will always be 1 row and not grow
$query = "INSERT INTO userProfile (choice) VALUES ('2')";
$result = mysql_query($query, $link);
?>
}
<!--end script-->
</script>
<td class="mainftr" colspan="0" align="center">
<input type="hidden" name="pcount" value="1">
Click to save your setting:
<input class="submit" type="submit" name="process_reminder" value="Save Preferences" onclick = "save()"> //javascript is call here when the Save button is clicked
</form>
</tr></table>
<?php
/ Closing connection /
mysql_close($link);
?>
Ok...I am going to bed now.
Thanks
aaa123