Javascript polls

  • sartori
  • Novice
  • Novice
  • sartori
  • Posts: 17

Post 3+ Months Ago

Is it possible to make a javascript poll that works from a database? *IE: I am working for school ... I am trying to make a web site that will elect a queen and king of hearts 'a lil' vote we got here'. I want to do this VIA polls and only one person can vote 1 time... No one number can vote more than once but the numbers are in a database for the school ... I can access them yes but I want the computer to automatically access the number, match it with the number logged in to the net right now, and then allow them a vote... save the info on if they voted or not ... then refresh the page with new information ... IF they try to vote more than once it says " You have already voted please wait until our next elections. Thank you!" IS this possible? *I know not much about Javascript but know more about other languages.
Sart!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

what type of database? Does the server support PHP?

And you can't do it in JS.
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

JS is client-side, so you cannot communicate to a database with it.

You also can't write to files with it, that would also require a server-side language such as PHP or ASP.

So... with JS, you could create a poll, but to be honest it really wouldn't be worth it because no data can be saved, so every time someone comes to your site the poll will be reset :lol:


You would need to use a server-side langauge such as PHP or ASP so that you would be able to read/write the data to a database or text file.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 87 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.