Why on earth won't this variable carry over?
//first file
$query = mysql_fetch_array(mysql_query("SELECT AVG(rated_number) AS average FROM gallery_ratings WHERE id = '".$id."'"));
$rating = number_format($query['average'], 1, '.', '');;
echo("
<td width='30%'>$fontString Rating: $rating</td>
<td width='70%'>");
$sql9 = "SELECT * FROM gallery_ratings WHERE image = '$id' && rater = '$username'";
$result9 = @mysql_query($sql9);
$row9 = mysql_fetch_array($result9);
if($row9['id'] == NULL){
echo("<form action=actions.php?cmd=rate_image method=post>
<input type=hidden name=image value=$id>
<select name=rating99>
<option value>10</option>
<option value>9</option>
<option value>8</option>
<option value>7</option>
<option value>6</option>
<option value>5</option>
<option value>4</option>
<option value>3</option>
<option value>2</option>
<option value>1</option>
</select>
<input type=submit value='Rate Image'>
</form>
");
}
//posts to
if($cmd == 'rate_image'){
$sql999 = "SELECT * FROM gallery_ratings WHERE rater = '$username' && image = '$image'";
$result999 = @mysql_query($sql999);
$test = mysql_fetch_array($result999);
if($test["id"] == NULL) {
$sql = "INSERT INTO gallery_ratings SET image = '$image', rater = '$myrow[username]', rated_number = '$rating99'";
echo("$fontString $sql<br>");
mysql_query($sql) or die ("<p>$sql<P>".mysql_errno().": ".mysql_error());
echo("
<center>$fontString
Thank you for your rating. Please click <a href=gallery.php>HERE</a> to go back to the gallery.
");
}
else{
echo("
<center>$fontString
You've already entered a rating for this image. Please click <a href=gallery.php>HERE</a> to go back to the gallery.
");
}
}
I've tried $_GET and it still doesn't work. Any idea why it wouldn't pass the $rating99 variable? It carry's everything else over, just not that one!