Voting Poll

Started on the old forum in November 2009 · view the original in the archive · old links redirect here

10 replies · 709 views · started 17 years ago · 1 min read

5 participants
subzero Super moderator Fellow · 3,954 posts #2

dont you think to add anti spam vote??

per user can vote once ??

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Mysterio Lead · 630 posts #4

how can it be once per user? I think they should be registeqed users for that to work. Because, how can the script if me is me again? Or, do you know any IMEI-reader script?

mysterio.al - programming is a functional art

subzero Super moderator Fellow · 3,954 posts #6
CREATE TABLE `vote` (
  `id` varchar(20) NOT NULL default '',
  `good` varchar(200) NOT NULL default '',
  `bad` varchar(200) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
if($_GET[a] == "vote")
{
$ip=$_SERVER['REMOTE_ADDR'];

$good = mysql_fetch_array(mysql_query("SELECT COUNT(good) FROM vote WHERE good"));

echo "GOOD: $good[0]<br/>";

$bad = mysql_fetch_array(mysql_query("SELECT COUNT(bad) FROM vote WHERE bad"));

echo "BAD: $bad[0]";

echo "
<form  method=\"post\" action=\"?a=voteadd\">
<div>
<select name=\"vote\">
<option value=\"good\" selected=\"selected\">GOOD</option>
<option value=\"bad\">BAD</option>
</select>
</div>
<div><input type=\"hidden\" name=\"id\" value=\"$ip\"/></div>
<div><input type=\"submit\" value=\"VOTE!\"/></div>
</form></div>";

}

if($_GET[a] == "voteadd")
{

$ip=$_SERVER['REMOTE_ADDR'];

$ip = mysql_fetch_array(mysql_query("SELECT id FROM vote WHERE id='$_POST[id]' "));

if($ip[0] == "$_POST[id]")
{

echo "<div style=\"text-align:center\"> You had voted before !!</div>";
echo "<div style=\"text-align:center\"><a href=\"?\">HOME</a></div>";

}
echo "<div style=\"text-align:center\">THANK YOU!!</div>";

if($_POST[vote] == "good")
{
$good = mysql_fetch_array(mysql_query("SELECT good FROM vote "));
$vo = $good[0] + 1;
$query=mysql_query("insert into vote(id,good) values('$_POST[id]','$vo')");
}
if($_POST[vote] == "bad")
{
$bad = mysql_fetch_array(mysql_query("SELECT bad FROM vote "));
$vo = $bad[0] + 1;
$query=mysql_query("insert into vote(id,bad) values('$_POST[id]','$vo')");
}
}

Here how i set my vote

also add a timer like 1 or 2 hours to update id to 0 again so users can vote later...

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #7

You can see mine you can mod it to rec there ip and delete later in hour or so

You coding is done good but with anti spam vote its good idea

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Mysterio Lead · 630 posts #8

subzero wrote:

CREATE TABLE `vote` (
  `id` varchar(20) NOT NULL default '',
  `good` varchar(200) NOT NULL default '',
  `bad` varchar(200) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
if($_GET[a] == "vote")
{
$ip=$_SERVER['REMOTE_ADDR'];

$good = mysql_fetch_array(mysql_query("SELECT COUNT(good) FROM vote WHERE good"));

echo "GOOD: $good[0]<br/>";

$bad = mysql_fetch_array(mysql_query("SELECT COUNT(bad) FROM vote WHERE bad"));

echo "BAD: $bad[0]";

echo "
<form  method=\"post\" action=\"?a=voteadd\">
<div>
<select name=\"vote\">
<option value=\"good\" selected=\"selected\">GOOD</option>
<option value=\"bad\">BAD</option>
</select>
</div>
<div><input type=\"hidden\" name=\"id\" value=\"$ip\"/></div>
<div><input type=\"submit\" value=\"VOTE!\"/></div>
</form></div>";

}

if($_GET[a] == "voteadd")
{

$ip=$_SERVER['REMOTE_ADDR'];


$ip = mysql_fetch_array(mysql_query("SELECT id FROM vote WHERE id='$_POST[id]' "));

if($ip[0] == "$_POST[id]")
{

echo "<div style=\"text-align:center\"> You had voted before !!</div>";
echo "<div style=\"text-align:center\"><a href=\"?\">HOME</a></div>";

}
echo "<div style=\"text-align:center\">THANK YOU!!</div>";

if($_POST[vote] == "good")
{
$good = mysql_fetch_array(mysql_query("SELECT good FROM vote "));
$vo = $good[0] + 1;
$query=mysql_query("insert into vote(id,good) values('$_POST[id]','$vo')");
}
if($_POST[vote] == "bad")
{
$bad = mysql_fetch_array(mysql_query("SELECT bad FROM vote "));
$vo = $bad[0] + 1;
$query=mysql_query("insert into vote(id,bad) values('$_POST[id]','$vo')");
}
}

Here how i set my vote

also add a timer like 1 or 2 hours to update id to 0 again so users can vote later...

subzero, is any way different? because in my country, each mobile has same ip. For exmpla, is any code to get the imei, so only one vote per imei?

mysterio.al - programming is a functional art

subzero Super moderator Fellow · 3,954 posts #9

you cant get imei lol not as yet but i think never will happen...

You can add time with ip addy

$ip=$_SERVER['REMOTE_ADDR']; $newip = str_replace(".","",$ip); $time = date("h"); echo "$newip$time";

this will show your ip1

so next hour user allow to vote.

also put a notice

Sorry you can vote right now try again in a hour.

Also you can change time to mins like H = hour M = Mins S = sec's

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close