Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    making a voting poll on my page

    hi all, can anyone point me 2 a tutorial on how to make a little voting thing on my page, ive looked 4 some premade ones but they dont really work for me. i need it WITHUT a database, please help
    If there is any LAWN BOWLERS that are under 16 here PM me!

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How do you want them to vote then? Saving the data to a textfile? Or do you want votes to be sent to your email box, and then you can update the stats as you like?

    Is it just a voting page or a poll where voters can see the current-up-to-date stats of the poll? If it's just voting, you can have them send it to your email for viewing, or save it to a textfile.

    If you don't want a database (like MySQL) but don't mind a textfile, you should checkout textDB:
    http://www.heroforhire.net/textDB/

    It's made by a member of CF. I haven't used it, but it looks like it should be cool.

    If you want stats, but don't want a database or a textfile, how do you plan on storing people's votes in order to derive stats?

    If nothing else, hopefully this post gets you thinking in the right direction. Either way, we need more information about what sort of poll you're trying to develop other than it can't use a database.

    Hope that helps,
    Sadiq.

  • #3
    Regular Coder
    Join Date
    Mar 2004
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use a textfile really easily, the problem would be making it graphical.
    PHP Code:
    $poll file("poll.txt"); // this does not record, just reads the current votes
    $option1 strlen($poll[0]);
    echo (
    "Option one: $option1 vote(s)<br>\n");
    $option2 strlen($poll[1]);
    echo (
    "Option two: $option2 vote(s)<br>\n");
    $option3 strlen($poll[2]);
    echo (
    "Option one: $option3 vote(s)<br>\n"); 
    That just records, in order to put votes in, just expand the line that the option is on one character, I assume you can do that, if not I can write that for you...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •