rizwanjavaid
9th June 2009 01:13 UTC
Calling hosted PHP scripts from NSIS
I am fairly new to NSIS. I am in the process of creating an NSIS installer. All is going well so far but now I have a small problem which I cannot find the answer for. I have a custom NSIS page with user details and I want to call a hosted PHP script to check if the user is registered via the info given. e.g. of flow:
1) User clicks next and now on user info page
2) User enters info, clicks Next
3) NSIS script should connect to http://mywebsite.com/checkuser.php?<params>
4) PHP checks Database and outputs result (SUCCESS or FAIL)
5) NSIS reads the result and takes action accordingly.
How do I call a URL like this without starting a web browser? Is it possible and is it possible to read the result from the page too (results come back in plain text).
NSI code would be greatly appreciated.
Thanks very much for your time and help.
Riz
Animaether
9th June 2009 03:16 UTC
any of the http download plugins (including nsisdl that comes with NSIS; there's also Inetc and InetLoad; just google them) should do the trick.
Just have your web server respond to a regular http URL request, with the information required as GET parameters ( something.php?username=something&whatever=somethingelse ) and spit out a text or HTML document, then parse that once downloaded.
Inetc and Inetload also support the POST method, if that would be preferred.
rizwanjavaid
9th June 2009 09:22 UTC
cheers for that, much appreciated, will look into it.
Milbo
15th June 2009 17:42 UTC
Simular problem
I have a simular problem.
I want to call a php site with data in the link. So I looked at Inetc and InetLoad, but it works not with proxy and SSL.
All proxy data is accessible. Hmm and next problem is the certificate. The certificate on the server is not registered, so browser ask if the it should be trusted. But what does nsis? I have the certificate, in java I say that is the certificate, just use it, done.
Maybe some can help me. Thanks
Milbo