从SWF到JavaScript再到数据库 [英] From SWF to JavaScript to Database

查看:78
本文介绍了从SWF到JavaScript再到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我希望你能提供帮助。我最近创建了一个SWF文件中的交互式学习视频。我需要能够监控人们何时完成测验,所以在完成后,我在测验中添加了一个按钮,可以调用操作JavaScript。



是否有可能,当用户点击此按钮时,JavaScript会将用户名发送到数据库?从环顾四周看,我认为这是不可能的,出于安全考虑,所以,我想知道是否知道任何黑客能够提供这个OR可以提供一个体面的教程吗?



环顾谷歌,代码片段中没有任何建议,我发现很难解读,因为我对此不感兴趣,



任何帮助将不胜感激,

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,

推荐答案

一般来说,您不会从客户端代码(例如Javascript,Flash等)与您的数据库交互。您将要选择服务器端Web语言/框架,如ASP.Net,Ruby on Rails,Python(其中一个是众多Web框架),Java(Servets或JSP)等,并从那。你说得对,这是出于安全考虑。通过这种方式,外部实体无法直接访问您的数据库或它的用户名/密码(您必须将其包含在JS中,非常不安全!)。



(就个人而言,我给出的示例列表中,如果你想要简单快速的东西,我推荐Ruby on Rails,你几乎不会为这么小的东西编写任何代码。)
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.)


这篇关于从SWF到JavaScript再到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆