Click here to Skip to main content
15,890,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I'm hoping you may be able to help. I have recently created an interactive learning video which is in a SWF file. I need to be able to monitor when people have completed the quiz, so upon completion, I have added a button into the quiz which can call to action a JavaScript.

Is it possible, that when a user clicks this button, the JavaScript will send the users name to a database? From looking around, I don't think this is possible, for security reasons, so, I'm wondering if any knows of any hacks to enable this OR can provide a decent tutorial?

Looking around on Google, the code snippets contain no advice and I'm finding it difficult to decipher as I'm a n00b to this,

Any help would be appreciated,
Posted

1 solution

Generally speaking, you don't interact with your database from client-side code (e.g. Javascript, Flash, etc). You're going to want to pick a server-side web language/framework, like ASP.Net, Ruby on Rails, Python (+ one of it's numerous web frameworks), Java (Servets or JSP), etc. and do it from that. You are right with what you say, this is for security reasons. By doing it this way, external entities do not have direct access to your database or it's username/password (which you would have to include in your JS, very unsafe!).

(Personally, of the example list I gave, I recommend Ruby on Rails if you want something simple and quick, you'll barely have too write any code for something this small.)
 
Share this answer
 
Comments
JohnoLFC 16-Jul-13 10:48am    
Thanks for the reply Lewax,

I'll have a browse for Ruby on Rails tutorials and see how I get on with that

Cheers

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900