Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Changins variables in javascript permanently and for all users?

Options
  • 06-01-2014 4:07pm
    #1
    Registered Users Posts: 225 ✭✭


    I have a simple web page which allows users to vote for one of several pictures. For each vote the variable representing each image increases by one. But upon refreshing, these variables of course reset back to their original values. I have read some stuff about local storage but I think that only changes the values permanently for each user. I need the values to be updated for every user permanently, if that makes sense.

    Anyone with any information on this topic? Help appreciated.


Comments

  • Registered Users Posts: 1,717 ✭✭✭Raging_Ninja


    I have a simple web page which allows users to vote for one of several pictures. For each vote the variable representing each image increases by one. But upon refreshing, these variables of course reset back to their original values. I have read some stuff about local storage but I think that only changes the values permanently for each user. I need the values to be updated for every user permanently, if that makes sense.

    Anyone with any information on this topic? Help appreciated.

    You're going to have to store the data on the server, in some form of database or file, and then pull the data from there when the users want to see it. When they vote, you'll need to update that database.


  • Registered Users Posts: 225 ✭✭TheSetMiner


    You're going to have to store the data on the server, in some form of database or file, and then pull the data from there when the users want to see it. When they vote, you'll need to update that database.

    Thanks for replying, can you recommend any databases to use? A quick google brings up an AJAX Database, have you heard of this provider?


  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    Your server side scripting language and database choice might have already been made for you. Is your site hosted online or is this just something you're mucking about with on your own computer?

    The most common combo is PHP and MySQL.


  • Registered Users Posts: 225 ✭✭TheSetMiner


    Your server side scripting language and database choice might have already been made for you. Is your site hosted online or is this just something you're mucking about with on your own computer?

    The most common combo is PHP and MySQL.

    Something I mucking about with on my own computer... programmed in javascript.


  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    Quickest and dirtiest way is PHP and MySQL or if you fancy doing something more interesting, a scripting language like Python or Ruby or if you really like Javascript, node.js.

    Database choice is less of a big deal. MySQL is fine here, or something like SQLite, perhaps?


  • Advertisement
  • Moderators, Technology & Internet Moderators Posts: 1,334 Mod ✭✭✭✭croo


    a server based "in memory" database would probably suffice ... derby, hsqldb or h2 are examples that sping to mind in the java world. If you look at grails, h2 comes ready to use out of the box.


  • Registered Users Posts: 3,866 ✭✭✭ozmo


    Lots of php etc advice above - which is good too - but don't forget about the Microsoft developer languages. Visual Studio Express is free - as is SQL Express for the database - and then you can debug the client side javascript and serverside Dotnet all in the one IDE debugger. Works really well locally on any standard windows pc. Lots of samples in there included and support out there.

    Your hosting server is Ideally going to need be windows server of course then...
    - can be your own pc (but wont be available on internet then of course)
    - or you can get a suitable blank windows server free for one year from amazon.com
    - or http://www.windowsazure.com do free trials also and they set it all up for you.


    or... be lazy and see if someone has written it already? I find www.doodle.com great for quick voting emails.

    “Roll it back”



Advertisement