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

  • Home
  • SEARCH
  • 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 5959973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:45:38+00:00 2026-05-22T18:45:38+00:00

5 star rating script I have is made based on this tutorial http://php.about.com/od/finishedphp1/ss/rating_script.htm I

  • 0

5 star rating script I have is made based on this tutorial http://php.about.com/od/finishedphp1/ss/rating_script.htm
I have changed it a bit based on comments on the mentioned site,but script still has some issues.
When i rate something script refreshes the site and adds the needed parameters in query string but the rest of the script is not triggered by it.

Echo "Rate "; 
Echo "<a href=".$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."?mode=vote&voted=1&id=".$data[id].">1</a> | "; 
Echo "<a href=".$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."?mode=vote&voted=2&id=".$data[id].">2</a> | "; 
Echo "<a href=".$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."?mode=vote&voted=3&id=".$data[id].">3</a> | "; 
Echo "<a href=".$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."?mode=vote&voted=4&id=".$data[id].">4</a> | "; 
Echo "<a href=".$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."?mode=vote&voted=5&id=".$data[id].">5</a>";

this thing is pretty much skipped.

$mode = $_GET['mode'];

$voted = $_GET['voted'];

$id = $_GET['id']; 


if ($mode=='vote') 
{   
if(isset($_COOKIE['146829gigapuding'])) 
    { 
    Echo "Sorry You have already ranked that site"; 
    } 
else 
    { 
    $month = 2592000 + time();
    setcookie('146829gigapuding',Voted,$month); 
    mysql_query ("UPDATE searchengine SET rating = rating+$voted, votes = votes+1 WHERE id = $id"); 
    Echo "Your vote has been cast"; 
    } 
}       

The sql connection,query and bunch of other code is there but there were no problems with it,i tried moving the code order but nothing.

Another thing that worries me is there a way to remove the ?mode=vote… parameters afther vote is cast.

tnx in advance.

  • 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-05-22T18:45:39+00:00Added an answer on May 22, 2026 at 6:45 pm

    As I see here

    ".$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."?mode=vote&voted=1&id=".$data[id]."
    

    you have ? (question mark) twice, which makes your url invalid. Try changing it to

    ".$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."&mode=vote&voted=1&id=".$data[id]."
    

    and see what will happen 🙂

    p.s.: the change is ? to & before mode

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using acunetix to test my website. The problem is with this script http://boedesign.com/blog/2007/02/18/ajax-star-rating/
I'm using the source code found on this site here: http://webtint.net/tutorials/5-star-rating-system-in-php-mysql-and-jquery/comment-page-1/#comment-2562 A fantastic resource,
I'm having trouble converting this 5 star rating script that works perfect with jquery
The script I have been working on for a star rating system, saves the
If you use a full, SEO Friendly URL like http://example.com/talks/about/star-wars then you can expect
I'm using jQuery Stars Rating plugin ( http://www.fyneworks.com/jquery/star-rating/ ). I'm having difficulty displaying an
Right now I have a 5 star rating system in my application, but the
I have been looking for a 5-Star rating control for a while now and
I have a included a Dojo star rating widget (dojox.form.Rating) in a Dojo form
I have built an application which is meant to take a star rating. The

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.