Affiliate Programs
 
Search affiliate programs for: 
Affiliate Categories
» Affiliate Networks
» Ad Networks
» 2 Tier Programs
» Pay Per Sale
» Pay Per Lead
» Residual Income
» Datafeeds
» Multi Tier Programs
» Business Opps
» Other Programs

Newsletter
Get newly added affiliate programs by email. Enter your email here:
Article Categories
» Affiliate Marketing
» Business
» Ecommerce
» Hosting
» Marketing
» Sales
» Web Designing
» Webmasters
» SEO & Promotion
» Working At Home
» Other Articles
» Affiliate Glossary


Go Back   AffiliateSeeking Forum > Website Creation, Design & Maintenance > Programming > PHP

PHP Discuss about your PHP scripting issues or help others with their PHP scripting problems.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-27-2009, 12:03 PM
amber.long83 amber.long83 is offline
Junior Member
 
Join Date: Nov 2009
Posts: 10
amber.long83 is on a distinguished road
Default php Poll

hello everyone

Anyone can please Provide me some code for Poll, I already working on the actual physical Poll code,But i want easier way to call variables for all the options in place of $option1, $option2 etc.

Code

/*
$con = mysql_connect("host,"username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("database", $con);

$result = mysql_query("SELECT * FROM polls WHERE poll_id = '$currentpoll'") or die(mysql_error());

while($row = mysql_fetch_array($result))
{

$option1 = $row[option1];
$option2 = $row[option2];
$option3 = $row[option3];
$op1total = $row[op1total];
$op2total = $row[op2total];
$op3total = $row[op3total];
*/
$option1 = Yes;
$option2 = No;
$option3 = Other;
$op1total = 5;
$op2total = 6;
$op3total = 2;
$total = $op1total + $op2total + $op3total;
$percent1 = $op1total / $total;
$percent2 = $op2total / $total;
$percent3 = $op3total / $total;
// }

echo 'Results';
echo '<br><br>';
echo "<table border=0><tr><td>" . $option1 . "</td><td> <img src=poll.gif height=20 width=" . $percent1 * 300 . "</img></td></tr>";
echo "<tr><td>" . $option2 . " </td><td><img src=poll.gif height=20 width=" . $percent2 * 300 . "</img></td></tr>";
echo "<tr><td>" . $option3 . " </td><td><img src=poll.gif height=20 width=" . $percent3 * 300 . "</img></td></tr></table>";


Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-06-2010, 05:30 AM
deveshraigniit deveshraigniit is offline
Member
 
Join Date: Nov 2010
Location: Delhi
Posts: 97
deveshraigniit is on a distinguished road
Hi,
Thank you for you share the your Experience..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-06-2010, 09:46 AM
MattCA MattCA is offline
Junior Member
 
Join Date: Nov 2010
Location: Rumia
Posts: 15
MattCA is on a distinguished road
Check on hotscripts, there is plenty of free poll PHP scripts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-08-2011, 08:34 AM
nancysparx nancysparx is offline
Senior Member
 
Join Date: Jun 2011
Posts: 174
nancysparx is on a distinguished road
For more knowledge you can simply follow:
http://www.w3schools.com/php/php_ajax_poll.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:40 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0
© 2004-2011 AffiliateSeeking. All rights reserved.