如何从我的安装程序将数据发送到php文件?

时间:2012-10-15 21:47:39

标签: php nsis

我正在尝试验证NSIS安装程序上的用户密码,因此我发送到我的编码php脚本来比较值。它似乎根本不与PHP脚本交互。我相信我的问题可能在PHP中。

<?php
include ("Encryption.php");
$data = $_POST;
$a = new encryption_class();
$encryption = //encryption code;
?>

<html><head>

<title> - </title></head>
<body>
    <? echo $data ?> <br>
    <? echo $encryption;?>

</body>
</html>

当我尝试使用post方法将安装程序中的信息发送到php脚本时,我觉得我错过了一些东西。

抱歉......这是NSIS电话

    Section
    SetOutPath $DOCUMENTS/
    StrCpy $1 "userpass"
    #text files for reading and writing with the post command
    File "pass.txt"
    File "encrypt.txt"

    #write the user variable to the pass.txt file
    ClearErrors
    FileOpen $0 pass.txt w
    IfErrors done
    FileWrite $0 "$1"
    FileClose $0
done:
    FileOpen $3 encrypt.txt w
    inetc::post $0 /FILE "http://mywebserver/installer_get_pass.php" $3 /END

SectionEnd

我还没有完成脚本但是当我打开应该写入输出的txt文件时它是空白的

1 个答案:

答案 0 :(得分:0)

inetc::post $0将(关闭!)文件句柄传递给插件。参数$3类似的问题,请尝试使用路径:

...
done:
StrCpy $0 "$documens\pass.txt"
StrCpy $3 "$documens\encoded.txt"
inetc::post $0 /FILE "http://mywebserver/installer_get_pass.php" $3 /END