使用php从输入到文件写入ecrypted

时间:2016-10-06 05:30:58

标签: javascript php

所以我有这2个javascript函数

$("#almost-button").click(function(){

    $("#almost-button").html(left_button_almost_state);
    var entered_email=
    $.ajax({
        type: "POST",
        url: 'save_email.php',
        data: {email:$("#email-text-box").val()},
        success: redirect(),
        dataType: 'text'
    });

    enable_access_button();

});

$("#access-button").click(function(){

    $("#access-button").html(left_button_submit_state);
    var entered_phone=
    $.ajax({
        type: "POST",
        url: 'save_email.php',
        data: {phone:$("#phone-text-box").val()},
        success: redirect(),
        dataType: 'text'
    });

});

都指向一个php文件,我有这个

        {include('setup/encryption.php');

        $email = encryptPaswd($_POST["email"],getEncryptKey());

        $phone = encryptPaswd($_POST["phone"],getEncryptKey());

        $file = fopen("setup/email.txt","a");

        fwrite($file,date('d/m/Y h:i:s a', time()) . "(".date("l"). "),".  $email .",".  $phone . "\n");

       fclose($file);}

所以我的问题是我无法按照自己的意愿写入de file。什么都没有得救。

0 个答案:

没有答案