Send Data to PHP-File via POST

Hey @ll,

atm iam looking for an Solution to send 2 Variables to an PHP-File.
Maybe iam searching with the wrong Keywords, or iam Blind maybe both^^

The adress looks like this: http://subdomain.tld.de/set.php?var1=1&var2=2
The PHP-File is saving the 2 variable to an textfile, if this information is needed.

I'll hope Someone can get me an Example how to send the Data to the PHP-File.

Have you looked at the http request node.
e.g.

[{"id":"b55b432041f9355f","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"var1\":1,\"var2\":2}","payloadType":"json","x":180,"y":1040,"wires":[["0ea5c4df1261a275"]]},{"id":"0ea5c4df1261a275","type":"http request","z":"b9860b4b9de8c8da","name":"","method":"GET","ret":"txt","paytoqs":"query","url":"http://subdomain.tld.de/set.php","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"credentials":{"user":"","password":""},"x":350,"y":1040,"wires":[["674f72cc236a0785"]]},{"id":"674f72cc236a0785","type":"debug","z":"b9860b4b9de8c8da","name":"debug 287","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":1040,"wires":[]}]

Yeah but iam having some trouble with it.

The first variable is static, but the second isnt static.

At the end iam having trouble to get the second variable into the http-request.
Atm the second variable is stored in msg.test

Then use a change node to move or set the payload object, Payload wil be attached as a query string to the url in this example

[{"id":"b55b432041f9355f","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"test","v":"2","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":130,"y":1040,"wires":[["c28d519b053c6a7c"]]},{"id":"c28d519b053c6a7c","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.var1","tot":"msg"},{"t":"set","p":"payload.var2","pt":"msg","to":"test","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":1040,"wires":[["0ea5c4df1261a275"]]},{"id":"0ea5c4df1261a275","type":"http request","z":"b9860b4b9de8c8da","name":"","method":"GET","ret":"txt","paytoqs":"query","url":"http://subdomain.tld.de/set.php","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":510,"y":1060,"wires":[["674f72cc236a0785"]]},{"id":"674f72cc236a0785","type":"debug","z":"b9860b4b9de8c8da","name":"debug 287","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":1060,"wires":[]}]

I'll give it a try in some minutes/hours, my BananaPi is making some trouble^^

Sry for not responding, atm theres so much ive to do that iam not able to test it. Hopefully today at the evening.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.