Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / I just made a high score system on my web site

Author
Message
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 14th Mar 2012 06:46 Edited at: 14th Mar 2012 07:42
The actuall making of the high score on my site was not difficult using web services such as just host, or any other hosting service using cpanel.

The hard part is actually connecting the data base to mysql, because you have to make it useable to mac and, eclipes.
This is what I am currently working on does any one here have experence with mysql can help me.

If any one has a guide that can show how to connect mysql with eclipes and xcode then please post.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps.
Developed the tiled map engine seen on the showcase.
Veterian for the military.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Mar 2012 09:14
You don't connect your app to the database (it's difficult and more to the point, it's dangerous!). You create a PHP web page, send a HTTPrequest for the page, and the page does all of the data access and returns it to your app. You can either receive it as HTML, otr receive it as raw data and format it when it arrives.

In AppGameKit Tier 1 none of this is possible until we get the HTTP commands.

3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 14th Mar 2012 13:44
I guess sending a html request looks more secure. So I guess I don't need to learn sql at the time thanks batvink. I now how to connect with windows with sql just not the other two, but what you said using html commands instead will be better.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps.
Developed the tiled map engine seen on the showcase.
Veterian for the military.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 14th Mar 2012 16:04 Edited at: 14th Mar 2012 16:05
You definitely will want to use the html request method to connect in a game.

If you want to be able to connect things external to the server that you do not have control over to your database, you have to allow all ip addresses connect access to your database.

Even if you make it user/password access only, you are opening your server up to major danger.

Direct connect from external sources is very much not recommended for security reasons.

When Tier 1 has the bits needed to do html requests, there are probably many users here (me included) who can help you with what you would need on the html side (probably really php, but that is a minor point).

Cheers,
Ancient Lady
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 14th Mar 2012 22:04
It looks really confusing to connect c++ with php ? From all the tutorials I have seen they show how to use php, but not how to set it up on c++.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps.
Developed the tiled map engine seen on the showcase.
Veterian for the military.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Mar 2012 00:04
You aren't connecting to PHP and c++. PHP is a method for generating (amongst other things) html formatted web pages. It allows you to connect to a database on the same server (or others, if they are set up badly).

There are some libraries that are supposed to let you create a c++ program and have it connect to a MySQL database on the same server (and others, but MySQL is usually free on most servers). And Java has classes that do the same (I have used these).

But they would both require opening the server up to all incoming IP addresses. And you do NOT want to do that for security reasons. And, if you are using shared hosting, your provider might not allow it.

You should use whatever the appropriate commands are that let you send a request to send an html type request to your site and get the results back.

The fact that the html request is going to a PHP generated page is information your c++/java doesn't need to know.

The PHP page in your html request will connect to the local database, perform whatever functions it is supposed to and 'return' a results.

If you use your web browser to look at the source of a displayed page, you will always see html (or xml). This is independent of whether the url is referencing a page that ends with '.html', '.php' or '.asp'. They all, ultimately, output html.

Cheers,
Ancient Lady
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Mar 2012 09:21
What you need to know is how to connect in PHP. A quick Google will find you all of the information, it's quite easy once you've put together your first test. Connecting is a couple of lines, running the SQL is a couple of lines, returning the results is just a small loop. Getting it back to your app is simply a case of receiving the HTTP response.

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 15th Mar 2012 11:01
Also, unless it's very big or very complicated you can use a text file on the server and not worry too much about MySql etc.

-- Jim
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 15th Mar 2012 20:51 Edited at: 15th Mar 2012 20:56
ok i finally found this
http://www.dreamincode.net/forums/topic/244215-introduction-to-creating-a-php-extension-for-windows/

Which allows me too connect c++ with php, It shows how to make dll, but I am still not sure how to make php work with xcode, and I looking for a tutorial for how to get information from my web site and, pass information using php, and html code.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps.
Developed the tiled map engine seen on the showcase.
Veterian for the military.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Mar 2012 23:56
No no no....please take note of everything above. You do NOT want to use C++ to connect to your high score table. You do not need to make an extension for PHP, you simply need to make a HTTP request to a PHP page. The PHP page will make the connection to MySQL.

Try this tutorial...

http://www.siteground.com/tutorials/php-mysql/database_connection.htm

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 16th Mar 2012 00:33
Totally agree with BatVink. C++ is irrelevant.

Send an HTTP request with the score and player name. The PHP script on the server replies with the high score table. It can be very simple!

-- Jim
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 16th Mar 2012 01:41 Edited at: 16th Mar 2012 02:35
so i guess then you have to use exec or the system command in c++ in order to pass the scores to your web site. That is the only way that I have found that Keeps php separate from c++. So From what I have seen here is that you can make a php file from c++ using ifstream then use the exec command to get request from your web site; Well I guess this will work be alot easier then trying to link php to work with eclipes and xcode.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps.
Developed the tiled map engine seen on the showcase.
Veterian for the military.
DMXtra
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United States
Posted: 16th Mar 2012 06:08
3d point in space,

PHP is a server based scripting language. It is on the web server ONLY. The PHP page will have some database connection code usually in an include file that is included on your web page (which is index.php for example).

The point is that your web server should be isolated against attacks and ONLY the PHP code can connect to the database.

Your C++ program (client) can use an HTTP call and do what is known as an HTTP Post (server), this will post variables with data directly into the PHP page, if you store that data in the database, make sure you filter for SQL Injection (this is where anyone can add to your query to do whatever they want to do -- including deleting records).

App Game Kit (A.G.K.) - Want to be creative on many platforms at once? This is the tool you need.
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 16th Mar 2012 08:31 Edited at: 16th Mar 2012 08:34
I guess I have too wait for html support in agk or figure out how too connect curl too agk. Because c++ does not do html connects natiivly.html comes out next update might have too wait tell then.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps.
Developed the tiled map engine seen on the showcase.
Veterian for the military.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Mar 2012 09:15
I don't know C++ or AppGameKit Tier 2, but if this was .NET then you would use HTPPRequest() and HTTPResponse().

Login to post a reply

Server time is: 2024-05-07 21:25:20
Your offset time is: 2024-05-07 21:25:20