I made a HTTP Request from a C++ Application using wininet and it works successfully to send data over to a php file using the following winapi functions
InternetOpen()
InternetConnect()
HttpOpebnRequest()
HttpSendRequest()
now It Sends the data over to a php file , fine and good but it doesnt Send all the parameters
for instance i have this parameter
username=jade101&password=svetlana123&submit=yes
It just sends only username=jade101
and throws the rest away.
the php i used to recieve the data looks like this
<?php
$data = $_GET['info'];
$fp = fopen('logga.txt','a+');
fwrite($fp, $data);
fclose($fp);
?>
What am i not getting correctly?
Primarily coding with CPP and having a fair knowledge of PHP, something that I can say looking at the limited code is the usage of $_GET.
How are you sending the data over to the php file? Is it by calling the PHP script itself by appending the string
"username=jade101&password=svetlana123&submit=yes"
to it?
Anyway, the $_GET will have to capture each variable separately. Something like:
$uname = $_GET['username'];
$upass = $_GET['password'];
$sflag = $_GET['submit'];
You can also try:
$data = $_SERVER["REQUEST_URI"];
To capture the complete URI starting from the script name and parse the string as you like later.
I don't see why the problem exists in C++ code, unless the send buffers were incorrectly used but that implementation is not visible in this code.