Web Analytics Made Easy -
StatCounter PHP Voting Thing - CodingForum


No announcement yet.

PHP Voting Thing

  • Filter
  • Time
  • Show
Clear All
new posts

  • Nightfire
    Here's a good tutorial to get you started with mysql

    Once you've got some mysql code started and you get stuck, give a shout and we'll try and help you, but of course you'd ask in the mysql forum for that help and not here

    Leave a comment:

  • punkpuke
    started a topic PHP Voting Thing

    PHP Voting Thing

    My goal is to make a Medal Voting page for my clan members on our site.
    I want it to do these things...

    1)Take the information. (The Person who voted, The member they voted for, and the medal they think the member should get) From the "Start New Vote" page. Did It all ready.
    2)I want to connect to a MySQL database and add the member and start a vote for the medal.

    3)Display all the current votes and a Yes or No input type whether they should get the Medal or not. (for the other people) Like a "voting pole".
    4)Check to make sure that the Session User (<?php strtolower($_SESSION['user']); ?>) hasn't voted in the particular vote before.
    5)Then expire the pole after 7 days. And Freeze it. (to be deleted by the admin on the page with a "Delete button").

    This is hard for me because I have never Deleted or Added anything to a MySQL database using the PHP. I've only done it manually.

    This is what I have so far...
    PHP Code:
    if ($REQUEST_METHOD == 'POST') {
    $the_voter $_REQUEST['voter'] ;
    $voted_member $_REQUEST['member'] ;
    $voted_medal $_REQUEST['medal'] ;

    if (empty(
    $the_voter) || empty($voted_member) || empty($voted_medal)){
    header"Location: error.html" );

    //Other Data Goes Here