温馨提示×

html提交数据如何加密

九三
596
2021-02-09 09:16:00
栏目: 编程语言

html提交数据如何加密

在html中使用MD5对提交数据进行加密

html代码如下:

<form id='test_form' action='' method='' omsubmit='return checkForm()'>

    <input type='text' name='username' value=''/>

    <input type='password'  id='input_pwd' value =''/>

    <input type='hidden' name='pwd' id='md5_pwd' value=''/>

    <button type='submit'>提交</button>

</form>

 

<script>

function checkForm(){

    var input_pwd= document.getElementById('input_pwd');

    var md5_pwd= document.getElementById('md5_pwd');

     md5_pwd.value= toMD5(input_pwd.value);           

    //进行下一步

    return ture;

}

</script>


0