Ok, I currently have three different pages in play here.
- Cigar.php - This is the individual cigar page, dynamically generated based on a GET Value
- Cigarreview.php - This is where a user goes to review a cigar. It has a drop down menu that pulls from the DB and based on which one the user selects, this value is passed to the #3 in the form of a POST value
- ProcessCigarReview - The script that actually processes the review, updates the db, works voodoo magic, etc
I would like to add an option on #1 to "Rate this Cigar" which would then redirect the user to #2 for a review. Once the user gets to #2, there would no longer be a dropdown menu, instead it would just be text with the name of the cigar and the applicable rating scale. I'm able to get this working no problem using a simple GET and if statement that checks to see if the GET value ISSET. The problem is #3. Currently that script looks for a POST value for the CigarID. I don't want to use a GET value to pass this info to the DB (for security reasons) and I also don't want to have a hidden form value.
Is there a way to get this value to pass that I'm not thinking of?
Applicable Code From #2
<?PHP
include 'dbconnection.php';
if (isset($CigarID)) {
$query = "Select CigarID,CName FROM cigar WHERE CigarID = $CigarID";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
$row = mysql_fetch_row($result);
echo "$row[1]";
echo "</td></tr>";
}
else {
echo "<select name=\"Cigar\">";
$query = "Select CigarID,CName FROM cigar";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
echo("<option select value=\"0\">Select Cigar</option>");
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_row($result)) {
echo("<option value=\"$row[0]\">$row[1] ($row[0])</option>");
}
}
else {
echo "No rows found!";
}
mysql_free_result($result);
echo "</select></td></tr>";
}
?>