Help needed ! creating ratings or reviewing

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
burnhallian
Forum Commoner
Posts: 28
Joined: Tue Jul 12, 2005 2:47 am

Help needed ! creating ratings or reviewing

Post by burnhallian »

Hello All, :D

Im new in this forum as well as new to PHP. I found PHP very robust. im supposed to create a page where in a user is asked different questions and then with the help od radio buttons he selects based on rating of 1 to 10. then once he submits, the average of rating 10 questions is given. can anyone help me in it. I dont know how to do that ? is ther eany avaiable code for that ?

Hope to see replies from people around.

regards
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

moved to PHP Code.

burnhallian, please make sure you post in the correct forum.
User avatar
burnhallian
Forum Commoner
Posts: 28
Joined: Tue Jul 12, 2005 2:47 am

Post by burnhallian »

sorry for that !! didnt know the rules.

Anyways...any replies to my post ? im eagerly waiting
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

take the results of the 10 quesitons add 'em all up, pour some salsa and guac on them and divide by 10.

ex:

Code: Select all

$result = 0;
$result += $_POST['result1'];
$result += $_POST['result2'];
$result += $_POST['result3'];
$result += $_POST['result4'];
$result += $_POST['result5'];
$result += $_POST['result6'];
$result += $_POST['result7'];
$result += $_POST['result8'];
$result += $_POST['result9'];
$result += $_POST['result10'];
// add salsa and guac here...
$result = ($result / 10);
echo $result;
User avatar
burnhallian
Forum Commoner
Posts: 28
Joined: Tue Jul 12, 2005 2:47 am

Post by burnhallian »

thanx man for ur prompt reply. Actually im very new to PHP so dont know much about it. i some how managed to write the code below, got some from books, net etc. Kindly see wether im doing ok or not. The code is below. Now what i need to do is that i take the values submitted and then i just add up the values. Can u plzz tell me what to do and how do i take the values from the code and do i need to write that in the new file analysis.php. Thanx in advance

" Sorry for the long code !! im removing it "
Last edited by burnhallian on Wed Jul 13, 2005 2:24 am, edited 2 times in total.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

waaaaaaaaaay too much code there for me to read that's not in php tags, the non-color hurts my eyes...please use php tags when posting code. Read here for info on posting code in the forums.

basically you'll just use what I posted above only you'll replace the result# var with your form vars:
dev, max, disad etc...
User avatar
burnhallian
Forum Commoner
Posts: 28
Joined: Tue Jul 12, 2005 2:47 am

Post by burnhallian »

thanx a lot man !! it worked ...

Keep up the good work :D
dreamline
Forum Contributor
Posts: 158
Joined: Fri May 28, 2004 2:37 am

Post by dreamline »

:) Take a look at my sig, go there and you'll find a rating system... :) Is that the sort of thing you were looking for? However i am using a popup for the rating system... :)
User avatar
burnhallian
Forum Commoner
Posts: 28
Joined: Tue Jul 12, 2005 2:47 am

Post by burnhallian »

thanx anyways .. i did it ! This forum is very much helpful :)
Post Reply