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

Recommended Answers

All 3 Replies

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.

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

Member Avatar for diafol

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.