Help a noob do stuff (Simple voting system)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
evilneko
Forum Newbie
Posts: 1
Joined: Tue Jul 22, 2003 10:52 pm

Help a noob do stuff (Simple voting system)

Post by evilneko »

Hi, im kinda stuck, so i was hoping someone could take a few mins to help me, to a php guru this would be like childsplay, but to me its totally pas my head :/

essentially, i would like 2 pages, the first (main), to display a table with 3 columns, and the second page containing the following
Username : Password : Selection 1 (dropdown menu) Selection 2 (dropdown menu), and finally a submit button and a clear button, when someone puts in the data, and hits submit, the data is sent to a prewritten peice of html/php with their selected options inserted, this is then written to a text file.

Code: Select all

<table width="600" border="0" cellspacing="1" cellpadding="0"> 
         <tr bgcolor="#F5FAFE"> 
           <td width="220"><div align="center"><font color="#666666" size="2" face="Verdana, Arial, Helvetica, sans-serif">***Data
                 1 example***</font></div> 
           </td> 
           <td width="215"><div align="center"><font color="#666666" size="2" face="Verdana, Arial, Helvetica, sans-serif">***Data
                 2 example***</font></div> 
           </td> 
           <td width="161"><div align="center"><font color="#666666" size="2" face="Verdana, Arial, Helvetica, sans-serif">***Username
                 example***</font></div> 
           </td> 
         </tr> 
       </table>
the username and password are stored in a plaintext file, with a third figure (either 0, or 1), which is checked/written by the vote.php file, if 0, the user may vote, if 1, the user is informed that he has already voted.

the data submitted into the text file upon voting, is added at the end of all data, as this file is written into the main pages html as an include (So it adds the data to a table, a new row for each vote)
hmm,. thats about it, ive attached the file with the dropdown menu values and mockup username database... i hope someone can see past my n00bness and help :/

the file with the data is at http://www.naoneo.com/help.zip or at least it will be when my host lets me login >_<
User avatar
award
Forum Newbie
Posts: 13
Joined: Tue Jul 15, 2003 10:45 am
Location: Wakefield, UK
Contact:

Post by award »

I got a poll from this website, its pretty easy to follow and alter to your needs. You may be able to extract some stuff to aid you in your project.

http://www.home.no/apron/english/apron. ... /index.php

It consists of 3 php pages, 1 with the radio buttons on, 1 to do the code and the last to display the results.
Post Reply