vote button, help please

Discussion in 'Web Design and Development' started by duncandeath, Oct 16, 2006.

  1. duncandeath macrumors member

    duncandeath

    Joined:
    Sep 7, 2005
    #1
    Hi mac dude's


    Im am pretty new to web design, and i woulld like some help.

    I would like to have a button that will display a number, when clicked i would like the number to increase. Just like a digg button, but a vote button.
    I would like to limit how many times pleople can vote as well.

    help will be much appriciated

    neil
     
  2. NoNameBrand macrumors 6502

    Joined:
    Nov 17, 2005
    Location:
    Halifax, Canada
    #2
    You need the following on your web host:
    -server-side scripting of some sort, such as CGI, PHP, JSP, etc.
    -either the ability to read/write a file from inside a scrip
    --OR--
    -a database, such as MySQL

    Do you have these things?
     
  3. duncandeath thread starter macrumors member

    duncandeath

    Joined:
    Sep 7, 2005
  4. ChicoWeb macrumors 65816

    ChicoWeb

    Joined:
    Aug 16, 2004
    Location:
    California
    #4
    Sounds like some Javascript. Have you tried googling something like this? I'd try javascript button counter or something to that effect. Otherwise you may be getting over your head. I don't think you'll need PHP or Mysql, you can store it in a flat file, it's not that sensitive. Then you have to plan if you want them to be able to vote more then once..etc.
     
  5. ThunderLounge macrumors 6502

    ThunderLounge

    Joined:
    Sep 20, 2006
    #5
    Sounds more like a mini hit counter than anything to me.

    You might be able to find something over at hotscripts.com, or a similar site.
     
  6. duncandeath thread starter macrumors member

    duncandeath

    Joined:
    Sep 7, 2005
    #6
    thanks for the replys guys, i have looked for javascript buttons but cannot find one. I have also searched for voting polls but no luck.
     
  7. NoNameBrand macrumors 6502

    Joined:
    Nov 17, 2005
    Location:
    Halifax, Canada
    #7
    uh, how would you get JavaScript to write to a file? or am I missing something (which I very well could be, I do server-side programming).



    Anyway, this is a great project for learning PHP/MySQL. Don't worry about integrating this with any existing sites, do it as it's own page to start with.

    A simple DB or flat file script is all you need. I would go with a database, personally.

    Go through a tutorial for setting up a database, and then create a table within it, with the following fields (for a poll that only counts votes and doesn't stop ballot stuffing):

    id, poll, choice, votes

    Sample data would be (you should add some data):
    0, 'favouriteColour', 'red', 3
    1, 'favouriteColour', 'blue', 8
    2, 'favouriteColour', 'day-glo', 1


    You then need to go through tutorials for:
    - connecting to a database
    - querying the database to pull data out
    - spitting data from the database out
    - updating the database from within PHP (which is just a query that you execute)
    - creating a form for user input
    - parsing user input
    - creating a query from user input to update the DB.

    You should be able to get through it in an evening or three. A book might help.
     
  8. andy89 macrumors 6502

    Joined:
    May 22, 2005
    Location:
    Folkestone, England
    #8
    all you need is a php script and a text file.
    I can put something together in my spare time if you like.
     
  9. ddekker macrumors regular

    Joined:
    Sep 23, 2006
    Location:
    Michigan
    #9
    vote

    go to hotscripts.com and search PLIGG..

    D
     
  10. duncandeath thread starter macrumors member

    duncandeath

    Joined:
    Sep 7, 2005
    #10
    if you could do that, it would be amazing.

    Having a bad week, i upgraded my hosting to allow for php etc, so then dreamweaver would not let me upload anymore. But that was no problem as 2 days later my computer starts freezing. Then it crashed and has not booted since.
    Tried all the repair tricks no luck, after running the hardware test the hard drive had this error

    2STF/8/3:ATA-100ata-6-Master

    so my hard drive has gone, well nearly. So it maybe a while before i get to work on this again. bummer.
     

Share This Page