954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

star ratings

how to write code for rating of website in php? help me;;;

muralikalpana
Posting Pro
540 posts since Sep 2009
Reputation Points: 21
Solved Threads: 36
 

It is simple, just like a grading system you assign each member/user a category base on his ranking and then print the appropriate image for his category. e.g if you are a newbie then the image that will be printed has one green start etc etc.

sureronald
Junior Poster
139 posts since May 2008
Reputation Points: 11
Solved Threads: 19
 
It is simple, just like a grading system you assign each member/user a category base on his ranking and then print the appropriate image for his category. e.g if you are a newbie then the image that will be printed has one green start etc etc.


if u have any sample code ....plz send me

muralikalpana
Posting Pro
540 posts since Sep 2009
Reputation Points: 21
Solved Threads: 36
 

I suggest using css rules referenced via classname for this, e.g.

<p class="user star_<?php echo $no_stars;?>"><?php echo $username;?></p>


Then in your css - this is a very rough example, just to give you an idea:

.user{
   padding-left: 20px;
   background-repeat: none;
}
.star_1{
 background-image: url(images/star1.gif);
}
.star_2{
 background-image: url(images/star2.gif);
}


etc etc

If you need to know how to extract personal data from the user's record in a db - see some tutorials.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You