PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WM calling PHP with parameters and get result
WM calling PHP with parameters and get result
Débuté par PETER ZHOU, 06 avr. 2018 03:05 - 2 réponses
Posté le 06 avril 2018 - 03:05
Hi,

WM and httprequest with php scripts, do i need to know things like user agent, additional http header information before i can use httprequest properly to get the correct result ?
or just pass the URL to httprequest e.g http://123.com/start.php with parameters will do?

Regards,

PETER ZHOU
Posté le 06 avril 2018 - 05:58
Quote
PETER ZHOU

Hi,



WM and httprequest with php scripts, do i need to know things like user agent, additional http header information before i can use httprequest properly to get the correct result ?

or just pass the URL to httprequest e.g http://123.com/start.php with parameters will do?



Regards,



PETER ZHOU

Usually I prefer to use PHP4WD or PHP4WM when it comes to accessing database through PHP. Check this out: http://27130.foren.mysnip.de/read.php…

But if you prefer to use direct PHP scripts then just use follows:
HTTPRequest("http://XxXxX.xxx/myphpscript.php…") IF ErrorOccurred = False THEN sResult is Buffer = HTTPGetResult(httpResult) //Process the Buffer as per your requirements END
I would advise you to please study the code of PHP4WD. You will learn a lot about how to use the HTTP features of WX properly with perfect error handling!!!

HTH
Posté le 06 avril 2018 - 12:33
Hi Peter

it depends of the PHP script and what it is expecting...

The main problem when you work with a webservice is generally the fact that string are by default in unicode on the mobile side, while they are in ansi on the server side... So if you don't convert one way or another, you end up with no understanding between the sides...

Best regards