image rating type thing?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
elecktricity
Forum Contributor
Posts: 128
Joined: Sun Sep 25, 2005 8:57 pm
Location: Trapped in my own little world.
Contact:

image rating type thing?

Post by elecktricity »

I have no clue how to do this, but I want were you can leave comments and in the comment theres 5 stars above it were you can rate it, I dont want radiobuttons I want it to be able to click which star you want and it to be in a variable when the form data is submitted kinda like this code below but I want the image to change colors like if you click the first one only the first star is litup, click the second star the second and first star is, and so on:

Code: Select all

<form action="vote.php" method="post">
<input type="radio" name="vote" value="1">1 star<br>
<input type="radio" name="vote" value="1">2 star<br>
<input type="radio" name="vote" value="1">3 star<br>
<input type="radio" name="vote" value="1">4 star<br>
<input type="radio" name="vote" value="1">5 star<br>
<textarea name="body"></textarea><br>
<input type="submit" value="Leave Comment">
</form>
pwhitrow
Forum Newbie
Posts: 3
Joined: Tue Mar 21, 2006 4:34 am

Post by pwhitrow »

Hi,

I wrote a rating script quite recently that I think would be useful to you. It's radio buttons right now, but there is no reason why you could not change this to be just buttons (or input type=image to make it even better).

Take a look and feel free to play with.

http://www.gr0w.com/articles/code/php_5 ... g_hreview/

example: http://www.gr0w.com/articles/rater_example.php

Paul
User avatar
elecktricity
Forum Contributor
Posts: 128
Joined: Sun Sep 25, 2005 8:57 pm
Location: Trapped in my own little world.
Contact:

Post by elecktricity »

im aware of knowing how to do that, but id like them to be able to click the star chart thing and set a variable, then type in a comment, then post them comment and add the score. I just dont know how to do the star part.
Post Reply