CMG Posted March 15, 2004 Share Posted March 15, 2004 Hi, I've been looking for tutorials on how to create polls for about 3 hours now and have come up with only previously created scripts which I can't follow. I'm new to PHP, so any help with this is appreciated. Creating the HTML form is not a problem... but for other users it may be useful. 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 . Thank you, Tom Walker CMG - Creative Marketing Group t_walker84@msn.com Quote Link to comment https://forums.phpfreaks.com/topic/1740-creating-a-poll-with-dreamweaver-mxphpmysql/ Share on other sites More sharing options...
CMG Posted March 16, 2004 Author Share Posted March 16, 2004 I figgued out how one might go about this... it may not work, but I don't see why it wouldn't. 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. Quote Link to comment https://forums.phpfreaks.com/topic/1740-creating-a-poll-with-dreamweaver-mxphpmysql/#findComment-5675 Share on other sites More sharing options...
morpheus.100 Posted March 22, 2004 Share Posted March 22, 2004 easier solution is to visit the XM site and download a great little php poll extension. Quote Link to comment https://forums.phpfreaks.com/topic/1740-creating-a-poll-with-dreamweaver-mxphpmysql/#findComment-5708 Share on other sites More sharing options...
ikool Posted August 8, 2004 Share Posted August 8, 2004 hello, You could find a really great poll script Here is you could port it to dreamweaver would be very happy but if you can it works fine as it is. Quote Link to comment https://forums.phpfreaks.com/topic/1740-creating-a-poll-with-dreamweaver-mxphpmysql/#findComment-6233 Share on other sites More sharing options...
FunkDOc Posted August 11, 2004 Share Posted August 11, 2004 Hello, 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 Quote Link to comment https://forums.phpfreaks.com/topic/1740-creating-a-poll-with-dreamweaver-mxphpmysql/#findComment-6246 Share on other sites More sharing options...
morpheus.100 Posted August 12, 2004 Share Posted August 12, 2004 It seems to have disappered into thin air. Looks like youre out of luck. It is easy howver to create your own with Dreamweaver. Just create a small dtabase with an id, num_votes, and rating colum. Snatch user ip and register it. Add 1 to number of votes. Add a rating value to rating and divide it by 2. It may be beneficial to create another table and log the voters ip and create a query to match the ip to the present day. This will help prevent flooding. 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. Quote Link to comment https://forums.phpfreaks.com/topic/1740-creating-a-poll-with-dreamweaver-mxphpmysql/#findComment-6248 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.