Archive: Is it possible to use POST instead of GET to send infos to PHP


Is it possible to use POST instead of GET to send infos to PHP
  I send registrations informations from an InstallOptions form to a php script on a web server using the excellent InetLoad.
I send the informations in the url using the GET method.
It works perfectly.

But I know POST is more secure especially if I want to use an encrypted connection to the server.

Is it possible to send informations from an InstallOptions custom page using the POST method ?


post.zip on this page http://ineum.narod*****inetload.htm includes test plug-in with POST support (/POST "Some text to post" parameter), simple Linux echo cgi (I wrote :) ), nsi and post.txt with my (successful) result. If anybody can test this - many thanks in advance. Especially with php's (I not wrote :( ).


Thank you Tachir.
I will test and let you know.


Takhir,

I've tested again. But I can't make it work.
It seems that there is not http error but the value of the variables are not transmitted to the server.

Here is the PHP code on the linux server :

$user_login= $_REQUEST***91;'lg'***93;;

>$user_password = $_REQUEST***91;'pw'***93;;

print$user_login;
print"<br>";
print$user_password;
print"<br>";
Here is the nsis code :


OutFile "testurl_post.exe"

var UserLogin
var UserPassword

ShowInstDetails show

Section ""

StrCpy $UserLogin "user"
StrCpy $UserPassword "pass"

InetLoad::load /post "lg=$UserLogin&pw=$UserPassword" \
"http://server/folder/checkuser_post.php" \
"C:\my_local_path\test_post.ini" /END

Pop $0
StrCmp $0 "OK" dlok
MessageBox MB_OK|MB_ICONEXCLAMATION "Error !. $0" /SD IDOK
dlok: ;download Ok, let's continue
DetailPrint "Return code [$0]"

SectionEnd


I have to rush to finish my actual program. So I will not have a lot of time to test this new post feature now.
I'll release a first version of my installer with GET.
When I have the time I'll test InetLoad with POST again and try to see why it does not work.
I'm sorry for not being able to continue to test with you. And thank you again for your precious time.

Takhir,

I am using your excellent plugin and also am interested in the ability to POST. I think I know why DavidV is not able to receive the variables from his POST, but I don't know how to fix it. I ran a sniffer while attempting to POST and saw that the following line was missing from the header...

Content-Type: application/x-www-form-urlencoded

Hope that helps!


Is there any other way to do this?


Thank you very much, Yardbird!
Sorry for delay, attached version adds (replaces) Content Type header in the POST request. Server program I used (post.c post.cgi, included) also prints to stdout all env vars, so you can check http headers. It also prints query string and POSTed data. Resulting file post.txt included to the package.