Passing PHP variable in loop to another PHP file via hyperlink
===

This is essentially a rating system where some text is displayed, users click good/bad, and the database has a vote added or subtracted from it. I am currently trying to do it like this:

File #1 (rate.php) - prints random database row with text in. There is a 'good' hyperlink which goes to good.php and a 'bad' hyperlink which goes to bad.php.

File #2 (good.php or bad.php) - Clicking the links adds or removes a vote to/from the database as appropriate and returns to rate.php via the header function.

I am currently having difficulty passing the variable from the while loop to good.php and bad.php. Because they are hyperlinks, there is no form.

Should I even be using a while loop? Is there a better way to structure the whole thing? Does this call for sessions?

**EDIT:**

Here is the while loop.


    $query = "SELECT * FROM challenges WHERE visible = 1 ORDER BY RAND() LIMIT 0,1";
    $result = mysql_query($query) or die(mysql_error());
    
    while($row = mysql_fetch_array($result)){
    	echo "<div id='box'>";
    	echo $row['challenge'];
    	echo "</div>";
    	echo "<div style='text-align: center; font-size: 12px;'>
    <span id='good'><a href='good.php'>good</a></span> &nbsp;
    <span id='skip'><a href='rate.php'>skip</a></span> &nbsp;
    <span id='bad'><a href='bad.php'>bad</a></span></div>";
    }

