I need to script something that opens a php page that executes a query. In particular i have to do a login / register. I already have the queries and the database working to do this (i have a working login/register on my site).
I wanted to use c++ directly to connect to the server and send query from the program but i i heard that is dicuraged becouse of security (and i even can't connect to the server unless i do it directly from the site).
So i found on internet that the best way to do this is write the connection to the server and the queries on a .php page that will than be called by the c++ program that also passes, in POST, the variables (username and password) to login or register.
I can write the php pages, but i don't know how to make the program.
Basically, in pseudocode, i want to do this
//Things i already know how to do
- read username from console
- read password from console
- read if the user wants to login or register
//Things i don't know how to do
- send username, password (and if the user wants to login or register) to a php page that can execute the right queries and connect to the db
- perform all the checks on the username (not duplicated etc)
By knowing how to open the php page i can also do other things i'm intrested in like create a log of the action taken by the user after connecting (in fact after logging in you can play a little game in DirectX so i can upload like the score or the time played etc) Thanks a lot