Forum Moderators: coopster

Message Too Old, No Replies

polls

i need a special script

         

WhosAWhata

3:37 am on Nov 12, 2003 (gmt 0)

10+ Year Member



I am looking for a script very similar to that of this earlier post
[webmasterworld.com ]
it would be similar in that it would be totally text based, as in using text links to vote, and displaying the results in text... like this
poll script:
<a href=poll.php?vote=1>1</a>
<a href=poll.php?vote=2>2</a>
<a href=poll.php?vote=3>3</a>

results:
1. ]]]]]]]]]] 50%
2. ]]]]]] 30%
3. ]]]] 20%

it has 2 limitations that i can see...my host doesn't allow SQL databases...so it needs to be flat file, and it cant use a <table> tag...not sure exactly why...

anyways i was just wondering if any of you have seen a script like this or one that would be easy to modify to be like this. THANKS

NeedScripts

4:57 am on Nov 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check out Advanced Poll @ [proxy2.de...] I am sure you will get all what you are looking for and little bit more ;)

Hope this helps.

NS

coopster

12:43 pm on Nov 12, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to Webmasterworld, WhosAWhata!

If you find you need to modify some code, get stuck or just need some general direction, fret not! Just come back here and there are plenty of good folk in this community that will get you through the tough stuff :)

WhosAWhata

10:47 pm on Nov 20, 2003 (gmt 0)

10+ Year Member



that script is great, except i can't figure out how to modify it for text links.
normally i would take the action part of the form tag, and add that in the links with a?result=...or someting, but this poll's action is $this->form_forward

HELP

WhosAWhata

6:57 am on Dec 22, 2003 (gmt 0)

10+ Year Member



i decided to make my own script but i'm having a little trouble displaying the results...could someone pile through this snippit and tell me what i'm doing wrong?

//count number of every vote
$vdir = "$userdir/votes";
$dh = opendir($vdir);
$vttl = 0;
while (false!== ($filename = readdir($dh))) {
$files[] = $filename;
if (($filename!= ".") AND ($filename!= "..")){
$vttl++; //total number of votes
include("$vdir/$filename");
for($i=1;$i<5;$i++) {
$qn = "nv$i";
$qn = stripslashes(htmlspecialchars($$qn));
if ($v == $i) { $qn++; }
} } }
for($i=1;$i<5;$i++) {
$qn = "nv$i";
$qn = stripslashes(htmlspecialchars($$qn));
$asdf = "ab$i";
$asdf = stripslashes(htmlspecialchars($$asdf));
$asdf = $qn/$vttl;
$asdf = $asdf*20;
// display results
$pb = "pa$i";
$pb = stripslashes(htmlspecialchars($$pb));
echo "<br>$pb ";
$asdf = stripslashes(htmlspecialchars($$asdf));
$asdf = $asdf-1;
for($l=1;$l<$asdf;$l++) {
echo "]";
} }

WhosAWhata

2:10 am on Dec 23, 2003 (gmt 0)

10+ Year Member



i know (or at least am pretty sure) this is a result of mathematical errors...but i just can't figure out exactly what's wrong with it