This is a piece of code am trying to use to post a set of 13 parameter values from the mql script to a external php script named upload.php
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
HttpSendRequestA expects in POST exactly the same data string as you would create for GET, i.e. param1=1¶m2=2
Thanks Ovo. Would you be able to put a example for me.
Here are the parameters:
x1="fskdjhf@gmail.com"
x2 = 10000
How do we make a HttpSendRequestA string out of this?
RaptorUk: I will take care next time.
Ok, once more.
x1=fskdjhf@gmail.com&x2=10000
bool HttpSendRequestA(int, string, int, string, int);
string data1="x1=GOD@GMAIL.com&x2=10000";
string acceptTypes[1] = {"*/*"}; int HttpOpen = InternetOpenA("HTTP_Client_Sample", 1, NULL, NULL, 0); int HttpConnect = InternetConnectA(HttpOpen, "127.0.0.1", 7777, NULL, NULL, 3, 0, 1); int HttpRequest = HttpOpenRequestA(HttpConnect, "POST", "/tradesheet/upload.php", NULL, NULL, acceptTypes, 0, 1); HttpSendRequestA(HttpRequest, headers, StringLen(headers), data1, StringLen(data1));
I tried your solution. It gives me an error "data1 incompatible types"
I have defined the variable data1 as a string.
Coupld you help please?
I tried your solution. It gives me an error "data1 incompatible types"
'IT' is the mql compiler which comes with the Metatrader. This is the mql code so will be compiled with the mql compiler.
'IT' is the mql compiler which comes with the Metatrader. This is the mql code so will be compiled with the mql compiler.
If your compiler cannot compile, then you very probably made a mistake.
You asked about the wininet.dll call, a format that HttpSendRequestA expects. You got the correct answer. If you like to play with the wininet.dll, you'd better consult some appropriate Microsoft page, it has nothing to do with the MQL.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This is a piece of code am trying to use to post a set of 13 parameter values from the mql script to a external php script named upload.php
The compiler keeps throwing an error that the "data" is an incompatible type. That data string was picked up from a site when I was searching for ways for mql to send POST params to php. But I need that string data to have my own parameter values but clueless on how to put it in the right format.
I tried searching quite a bit and just cant find anything helpful.
The following is the parameter list that I need to send to upload.php. Can someone please help me arrange in the format that HttpSendRequestA is expecting it ?
Thanks a ton