473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PHP Dynamic Rating Bar

384 256MB
I'm trying to create a dynamic rating bar which is out of 10, data is retrieved from the DB and is from 1 to 10, i was trying to use the imagefilledrectangle() function with no luck, any suggestions on an easier way to create one?
Dec 9 '08 #1
2 3876
Atli
5,058 Expert 4TB
Hi ziycon.

I don't really get what the problem is.
Are you having difficulties displaying the data, or what?

If you simply need to show a "progress bar" of sorts to represent the rating, you could try just using CSS.

Like, say:
Expand|Select|Wrap|Line Numbers
  1. <div style="width: 100px; height: 20px; background: #000;">
  2.     <div style="width: <?php echo ($rating * 10); ?>%; height: 20px; background: #AAA;"></div>
  3. </div>
  4.  
Where $rating is a value between 0 and 10.

If that isn't what you are looking for, please try explaining the problem a little better.
Dec 9 '08 #2
ziycon
384 256MB
Got it sorted, i used CSS to display a bar based on a calculation out of 100%.
Dec 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: jeremy | last post by:
this is probably a simple sql solution, but i could use some help. i've got one table that has rows of documents, and another table with any number of ratings for each of the documents. The rating...
2
by: alex | last post by:
I need a more advanced formula than just an average for calculating items rating. I have: raitng value is on scale 1 to 10. s - sum of all ratings for an item n - number of rates (votes)
0
by: soma | last post by:
I have a rating system on a forum I'm building. Users can rate a topic either good or bad. For each Good rating, one point is added to the topic's score. For every Bad rating, one point is subtracted...
8
by: kp87 | last post by:
I am a little bit stuck .... I want to play a bunch of soundfiles randomly, but i want to give each soundfile a rating (say 0-100) and have the likelihood that the file be chosen be tied to its...
4
by: bp90210 | last post by:
If you have a few minutes, I would like to see if anyone can help me out. I'm trying to modify a rating script. Currently, It allows you to vote over and over. What I want to do is after you vote...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
1
by: lamarant | last post by:
Hi...I'm trying to use the Rating Control in the Ajax Toolkit in a datalist. I have the control showing up in the list, with the logged in users current rating for each item in the list showing... ...
1
pradeepjain
by: pradeepjain | last post by:
Hii guys , I have several products in my mysql database and i wanna allow the authorized users to rate the products !! i am clear till this point like it has to be done with the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.