-
Posts
131 -
Joined
-
Last visited
Posts posted by pro_se
-
-
oh! lol... ic!!! thanks u guys...
-
Can you maybe give me a sample solution of a Session? Maybe you can refer me to someone elses work?
-
[b]I want to create a cookie and send it to a users machine to see if they voted yet... [i]this is what i have... [/i][/b]
[code]<?
mysql_connect("localhost","root","poop");
mysql_select_db("monkey");
$id = $_GET["id"];
$sql = "UPDATE links SET total_votes = total_votes + 1 WHERE id='$id'";
$result = mysql_query($sql);
echo "<b>You have been counted...</b>";
?>[/code]
[u]is there any way to incorp. a cookie system into that?[/u] -
WOW!!! thanks!!!!
-
[b]Hello... I am trying to create a voting system like digg where you click a link and it adds one in a database... [i]this is what i have so far:[/i][/b]
[code]<?
mysql_connect("localhost","poop","monkey");
mysql_select_db("funky");
$id = $_GET["id"];
$total_votes = $r['total_votes'];
$one = 1;
$add = ($total_votes + $one);
$sql = "UPDATE links SET total_votes=$add WHERE id=$id";
$result = mysql_query($sql);
echo "Plus 1... added...";
?>[/code]
[u]it does not work... maybe someone can help me?[/u]
Set cookies to see if user voted?
in PHP Coding Help
Posted
$_SESSION['voted'] = "yes";
if ($_SESSION == "yes") {
echo("<b>You Have voted already!</b>");
} else {
mysql_connect("localhost","poop","bogus");
mysql_select_db("hizzr");
$id = $_GET["id"];
$sql = "UPDATE links SET total_votes = total_votes + 1 WHERE id='$id'";
$result = mysql_query($sql);
echo("<b>Vote counted!</b>");
}?>[/code]