Creating a Poll with Dreamweaver MX/PHP/MySQL
Posted 15 March 2004 - 09:31 PM
What I want to do is create a poll which sits underneith the navigation column of my website. It will have 2-5 radio button options, 1 vote per IP address (per day if possible). A submit button at the bottom. 1 option max per vote (can't select more than 1 button). When the user hits submit, the page re-loads, and displays the results in percentages with a horizontal orange bar for the leader, and horizontal blue bars for the others where the options had been previously.
What I'm hoping to get is a link to a step-by-step tutorial for accomplishing this using dreamweaver MX, or for some helpful, Godly person to write one up for me, though that's a bit of a long shot .
CMG - Creative Marketing Group
Posted 16 March 2004 - 09:50 AM
The gameplan is:
1)Create the form so that when it submits the url thing changes to say, url?vote=no
2)Some database ads 1 to its "no" variable, and 1 to its "total" variable.
3)We get 3 bits of data with something like $vote = $_REQUEST[database[no/yes/total]]; (I dunno how to do it)
4)We then make a graphic named "red_spacer.gif" and do something like:
<?php $yes_percent = $vote[yes]/$vote[total];
echo <img src="images/red_spacer.gif" width=$yes_percent>;
echo <img src="images/red_spacer.gif" width=$no_percent>; ?>
I think that might work. I just don't know how to code it, and I don't know how to make a database like that. I've only done those "company name, telephone number, etc." ones from tutorials with phpMyAdmin so far.
If any PHP/MySQL Wizz can cook up some code for me, it'd be much appreciated. I'd really like to actually learn how to do the database stuff though. If you could do a step-by-step thing for that, and then just cut/paste the php code (cuz I can probably figgure that out from analysis) it'd be appreciated. Thx.
Posted 22 March 2004 - 11:41 AM
Posted 11 August 2004 - 11:31 AM
morpheus.100 would you please post the url for the poll extension.
I can't find neither xm's site nor bigmac's site.
Thanks for your help
Posted 12 August 2004 - 07:52 AM
Show images with show image and base the condition on a numerical value or use a percentage calculation if you wish to use infinitly expabdable graphics.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users