Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8269289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:10:37+00:00 2026-06-08T06:10:37+00:00

This is essentially a rating system where some text is displayed, users click good/bad,

  • 0

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>";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:10:38+00:00Added an answer on June 8, 2026 at 6:10 am

    just pass a row ID with GET variable

    good.php?row_id=12345
    bad.php?row_id=12345
    

    in good.php and bad.php it becomes a variable like:

    $_GET['row_id']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question has been bugging me for a long time now but essentially I'm
So I essentially need to do this: String text = line1\n; text += line2\n;
I have an existing database of a film rental system. Each film has a
I have some entries in my database, in my case Videos with a rating
So I have a DOM document that looks essentially like this <categories> <category id=1/>
This questions involves 2 different implementations of essentially the same code. First, using delegate
Essentially, is there any way to make this code legal? main = print .
I have a schema that essentially looks like this: CREATE TABLE `data` ( `id`
This seems like a basic question, but I haven't found any clear answers. Essentially,
I'm writing a cache-eject method that essentially looks like this: while ( myHashSet.Count >

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.