Jump to content

PHP voting system


Benn

Recommended Posts

Hey there peeps. Im new to the game of php and i was wondering if there is a way to add in a voting system to my photo gallery? I already have a script to automatically upload images into the gallery but i would also like a voting system. say for example one of the photos come up and underneath that there is a series of numbers ranging from 1-10 and you click, using radio buttons which mark you think the photo is worth.

 

Anybody help me out  ??? PLease PLease

 

cheers

 

Benn

Link to comment
https://forums.phpfreaks.com/topic/40607-php-voting-system/
Share on other sites

easy, do you want to do this with a database? if so all you do is make a series of radio buttons like

 

<input type="radio" name="vote" value="1">

 

and do that for each of them.

 

once they click it you can go to a process.php page which might look like this

 

<?php
$vote = $_POST['vote'];

$sql = "UPDATE table SET vote = vote + 1 WHERE vote = $vote";
mysql_query($sql);
?>

 

you can have ten rows in the database 1-10 for each vote, then when someone submits a vote you can update that vote row and add one to it

 

 

Link to comment
https://forums.phpfreaks.com/topic/40607-php-voting-system/#findComment-196415
Share on other sites

Cheers for that jwk811

 

I was planing on using a database. Say i have my gallery already running and it works by a php script that looks in a folder where the images get uploaded and then automatically loads in these images providing they are .jpg format regardless of size. How can i then use this script to run along side this? The gallery was made using flash.

 

Or would it be easier to make a table of all the images somehow in dreamweaver that uses the voting system? But ideally i would like to have the voting system inside the gallery? Any ideas on how to go through this?

 

cheers

 

Benn

Link to comment
https://forums.phpfreaks.com/topic/40607-php-voting-system/#findComment-196748
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.