Okay, I figured out part of this, and wrote the script below. However, whenever I submit, the script errors out.
Anyone spot what I have done wrong?
//radio buttons (these are generated in a loop)
<input name="spotlight_l" type="radio" value="' . $id . '" checked="checked"/>
//submit script
<?php
if($submit) {
foreach ($HTTP_POST_VARS as $name=>$value){
$i=1;
if ($name == "spotlight_l"){
$SQL = "UPDATE homepage SET spotlight_l='$i' WHERE hpid='$value'";
$result = mysql_query($sql) or die("db query failed_1");
} else {
if ($name == "spotlight_r"){
$SQL = "UPDATE homepage SET spotlight_r='$i' WHERE hpid='$value'";
$result = mysql_query($sql) or die("db query failed_2");}
}
}
}
?>