Jump to content

Search the Community

Showing results for tags 'vote'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 4 results

  1. Hi all, I want to make a quiz but I'm stock in the process. I've created a form with radiobuttons with questions, so for example: Question 1: Q1A,Q1B,Q1C Question 2: Q2A,Q2B,Q2C After visitors filled in the answers, the form post it to my results.php. This works perfectly. Now I have a MySQL database with: +----------+--------+-----+-----+-----+-----+-----+-----+ | PRODUCT | BRAND | Q1A | Q1B | Q1C | Q2A | Q2B | Q2C | +----------+--------+-----+-----+-----+-----+-----+-----+ | | | | | | | | | | product1 | Apple | 1 | 0 | 1 | 0 | 1 | 0 | | | | | | | | | | | product2 | HP | 0 | 1 | 1 | 1 | 1 | 1 | | | | | | | | | | | product3 | Dell | 0 | 0 | 0 | 0 | 1 | 0 | | | | | | | | | | | product4 | Compaq | 1 | 1 | 1 | 0 | 0 | 0 | +----------+--------+-----+-----+-----+-----+-----+-----+ So if the user select Q1C in question A and Q2A in question B, I want to count all the values from the selected columns, so in this case: Product1 = 1 + 0 = 1 Product2 = 1 + 1 = 2 Product3 = 0 + 0 = 0 Product4 = 1 + 0 = 1 Product 2 wins and is most relevant. I then want to show the top 3 on the page. In total I have about 20 questions and 400 products and I want to create a top 3 list, based on the selected answers. I have a few questions: 1) Is this possible? Or are there better ways to make a election/voting script? Any examples? 2) How can I add the values from multiple columns together and make a total score for the visitor? For example, I need something like this: http://www.stemwijzer.nl/votematch2k2006/app.html I really hope you guys can help me with this! I really want this!! Thanks so much in advance!! Kind regards, Mark
  2. Hi, I have set up a number of pages with a vote poll on them, I need the page to refresh when the submit button is pressed, the php code is: I have tried doing it without the window.location.reload() but it makes not difference echo '<td width="330" valign="top"> <div class="vpolls" id="vp_1"> <div class="vpdt"></div> <span class="h5">Do you agree with this new system of collecting Council Tax? </span> <form action="http://www.tckennedy.co.uk/vpoll/vpoll.php" id="vpf1" method="post" onsubmit="return votePoll(this);window.location.reload();"> <input type="hidden" name="idp" value="1" /> <label for="p1i0"><input type="radio" name="item" value="Yes" id="p1i0" />Yes</label> <label for="p1i1"><input type="radio" name="item" value="No" id="p1i1" />No</label> <label for="p1i2"><input type="radio" name="item" value="Undecided" id="p1i2" /> Undecided</label> <input type="submit" value="Vote" name="sbm" /> <br> <p><span class="p5">Please note that only one vote per person is now permitted for each poll</span></p> </form> </div></td>'; echo '<td width="10"><p> </p></td>'; echo '<td width="330" valign="top">'; include('vpoll/vpoll.php'); echo '<div class="vpolls">'. $obVot->showPoll(1) .'</div>'; echo '</td>'; echo '<td width="290"></td>'; echo '</tr>'; echo '</table>'; ?> The website is tckennedy.co.uk where you can see what is happening. I need the page to refresh when the vote button is pressed and the results to update. Any help with this would be really gratefully recieved. Thanks
  3. Dear php masters, I need to create a voting system. but not with radio buttons, lets say with 5-10 small icons. The idea is when you click on the icon- your voice goes on its scale and will display number of votes for each and every icon. the same for all 10 different icons. one person (pc) can vote only once for a week and display a message (thank you for your vote!), if s.o. tries to vote again - a message will display ("you already voted!") and it requires logging in before voting. also with one click(button) the admin will restart votes from zero. next to this voting system will goes another one with all votes(with numbers) from the begging . Thanks in advance!
  4. I'm working on a five star voting system for a website and I have very limited knowledge of cookies and javascript for that matter. I'm attempting to limit users to only one vote per instance so I'm guessing I'll need some sort of count and a cookie tracking system that could delete after a couple days. I'm not necessarily worried about people clearing cache as the votes aren't incredibly important but I definitely don't want the ability to keep voting via click. Here is what I've accomplished so far: <script> $(document).ready(function() { $('.rate_widget').each(function(i) { var widget = this; var out_data = { widget_id : $(widget).attr('id'), fetch: 1 }; $.post( 'ratings.php', out_data, function(INFO) { $(widget).data( 'fsr', INFO ); set_votes(widget); }, 'json' ); }); $('.ratings_stars').hover( function() { $(this).prevAll().andSelf().addClass('ratings_over'); $(this).nextAll().removeClass('ratings_vote'); }, function() { $(this).prevAll().andSelf().removeClass('ratings_over'); // can't use 'this' because it wont contain the updated data set_votes($(this).parent()); } ); $('.ratings_stars').bind('click', function() { var star = this; var widget = $(this).parent(); var clicked_data = { clicked_on : $(star).attr('class'), widget_id : $(star).parent().attr('id') }; $.post( 'ratings.php', clicked_data, function(INFO) { widget.data( 'fsr', INFO ); set_votes(widget); }, 'json' ); }); }); function set_votes(widget) { var avg = $(widget).data('fsr').whole_avg; var votes = $(widget).data('fsr').number_votes; var exact = $(widget).data('fsr').dec_avg; window.console && console.log('and now in set_votes, it thinks the fsr is ' + $(widget).data('fsr').number_votes); $(widget).find('.star_' + avg).prevAll().andSelf().addClass('ratings_vote'); $(widget).find('.star_' + avg).nextAll().removeClass('ratings_vote'); $(widget).find('.total_votes').text( votes + ' votes recorded (' + exact + ' rating)' ); } </script>
×
×
  • 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.