C++ and PHP

Hello, I am new to C++. Played with it for a week or so. I only know the basics (variables, arrays, functions, multi-threading). I consider I have solid knowledge about ActionScript3, and I know some PHP.

I have my PHP file on the web. I want to load it via C++.

Pseudocode:
1
2
3
4
START
ENTER A STRING
LOAD HTTP://EXAMPLE.COM/EXAMPLE.PHP?ARG=STRING
END


I have problems converting that into C++ code. Here's what I have:

1
2
3
4
5
6
7
8
9
10
#include <iostream>
using namespace std;
int main(){
string myStr;
cout << "enter your string: \r\n";
cin >> myStr;
//load HTTP://EXAMPLE.COM/EXAMPLE.PHP?ARG=STRING
cin.ignore();
return 0;
}


If you can, please help me. Thank you in advance.
Last edited on
Firstly, use the getline() function when working with string objects: getline(cin, myStr);

Not completely sure what you want but try looking at libcurl: http://curl.haxx.se/libcurl/
Guys!

I would suggest you to begin with scanf for a while that is running somewhere in PHP backround then end up with printf afterwards.
I am new to C++ programming as well, but just checking one thing. In your code, I didn't see
#include <string>
You probably did do it but shortened your code for demonstration, but just checking :D
Last edited on
Topic archived. No new replies allowed.