The following code works perfectly on my localhost machine. I haven't changed any code, apart from the username and password of the database. I'm a relative newbie to PHP, but all I'm wanting to do is have the user selected radio button information stored in the database. Here is my php..
session_start();
if(isset($_POST['submit'])){
$conn = mysql_connect($HOSTNAME, $USERNAME, $PASSWORD)or die( 'Could not connect: ' . mysql_error());
//mysql_select_db($DATABASE_NAME);
mysql_select_db($DATABASE_NAME, $conn) or die('');
if (isset($_SESSION['username'])){
$username= $_SESSION['username'];
} else{
$username= "FAIL";
}
$informant="informant";
$mobilitylist ="mobilitylist";
$transferslist ="transferslist";
$dressinglist ="dressinglist";
$toiletlist ="toiletlist";
$bladderlist ="bladderlist";
$bowelslist ="bowelslist";
$groominglist ="groominglist";
$feedinglist ="feedinglist";
$bathinglist ="bathinglist";
$stairslist ="stairslist";
mysql_query("INSERT INTO digitaladl2 ($informant, $mobilitylist, $transferslist, $dressinglist, $toiletlist, $bladderlist, $bowelslist, $groominglist, $feedinglist, $bathinglist, $stairslist, username)
VALUES ('".$_POST['informant']."','".$_POST['mobilitylist']."','".$_POST['transferslist']."',
'".$_POST['dressinglist']."','".$_POST['toiletlist']."','".$_POST['bladderlist']."','".$_POST['bowelslist']."'
,'".$_POST['groominglist']."','".$_POST['feedinglist']."','".$_POST['bathinglist']."','".$_POST['stairslist']."','".$username."')");
}
?>
The html form is too long to paste all fields, so here is just the first two radio button selections.
<h4> Specifiy the informant when the Barthal Index is done in the community </h4>
<input type="radio" name="informant" value="Patient">Patient<br>
<input type="radio" name="informant" value="Main Support Person">Main Support Person<br>
<input type="radio" name="informant" value="Both">Both<br>
<input type="radio" name="informant" value="Other">Other<br>
<h4><p> Mobility </p></h4>
<input type="radio" name="mobilitylist" class="0" value="Immobile" >0 Immobile<br>
<input type="radio" name="mobilitylist" class="1" value="Wheelchair independant (including corners/doors)" >1 Wheelchair independant (including corners/doors)<br>
<input type="radio" name="mobilitylist" class="2" value="Help of one untrained person, including supervision" >2 Help of one untrained person, including supervision<br>
<input type="radio" name="mobilitylist" class="3" value="Independant (may use aid)" >3 Independant (may use aid) <br>
Once the form is submitted on the live server, nothing happens - no data is entered into the database. Yet runs perfectly on the localhost server. Thanks in advance, all help appreciated!