Jump to content

pro_se

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by pro_se

  1. wow... it looks like its going to work but it does not... i must be doing somthing wrong... here is my code... [code]<?php session_start(); $_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]
  2. Can you maybe give me a sample solution of a Session? Maybe you can refer me to someone elses work?
  3. [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]
  4. [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]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.