English 中文(简体)
J Query $ get() 报表有安全漏洞?
原标题:JQuery $.get() statement have security holes?

因此,我正在撰写一份文字,使用户能够登记和签署我的网站。 这些资料是从只要求用户名和密码的超文本形式收集的。 在这里,我做些什么被 down倒。

<form name="registration" id="registration" method="post" action="register.php">
    <input type="text" id="username">
    <input type="password" id="password">
    <input type="button" id="sendinfo">
</form>

我想利用日本宇宙航空研究开发机构与JQuery收集表格中的数据并将其输入数据库,以便用户在登记时不必从网页上删除。 因此,我做这样的事情:

<script type="text/javascript" src="jquery-1.7.1.js"></script>
<script type="text/javascript">

    $(document).ready(function(e){

        var user = $("#username").val();
        var pass = $("#password").val();

        $("#sendinfo").click(function(){

            //Send data to php file                 
            $.get("register.php?", {uname: user, pass: pass}, function (msg, status, xhr){
                alert(msg);
            });

        });

    });

</script>

是否向“登记员.php”发出密码,向整个安全开放?

问题回答

你们应当使用POST而不是GET。 GET参数将在服务器记录中显示。 你不想这样做。 此外,还考虑将客户和服务器之间的数据加密。

您应使用HTTPS,以避免出现安全问题。 这样,客户与服务器之间的通信便使用证书和。 t 能够读到交通数据。

Not more than a normal submit would. You can enhance the security by adding SSL, to encrypt the data while sending it. Also if you are using a simple hashing algorithm for storing the password (like MD5 or SHA1), you could hash the password with Javascript before sending it.





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签