Jump to content


Photo
- - - - -

[GMHTML5/GMS] User Login/Game Saving PHP


  • Please log in to reply
4 replies to this topic

#1 Destron

Destron

    GMC Member

  • GMC Member
  • 918 posts
  • Version:GM:HTML5

Posted 31 March 2012 - 03:07 AM

  • Title: User Login/Game Saving Using PHP/MySQL/Asynchronous
  • Description: Detailed example of how to create a user account, log in, and save/load info using async functions.
  • GM Version: :GMHTML5: :GMS:
  • Registered: Yes
  • File Type: .zip (The only approved archive), .etc (other formats are OK, but you MUST include a ZIP or .gm6/k file
  • File Size: 1.44MB
  • File Link: My link
  • Required Extensions: None
  • Required DLLs: None
Summary

You can view the example live here: VIEW LIVE EXAMPLE

This is a detailed example of how to use Asynchronous functions to communicate with a PHP script. This example shows you how to create a new user account, login to said account, save information to the database, and pull that information back out of the database and load it in the game. You do not need to know PHP to use this, you just have to understand what edits to make to the included PHP file and that is completely detailed through comments in the files themselves and the included PDF.

If it is warranted, I will continue to develop and add functions to this example.

The archive includes:

The .gmz project file for GM:HTML5 or GMS
The sample complied website
The PHP script that contains the functions you will call
A .sql file with a sample database to get you running fast for experimentation.
3 PDF files, a Quick Setup guide, A guide that details all the PHP code, and a guide that details the GM parts.

Required:
PHP/MySQL enabled Webhost
Ability to create and modify a database on your webhost
FPT client
Notepad or other NON rich text editor (I suggest notepad++)
Ability to read



You can view the example live here: VIEW LIVE EXAMPLE

Potential additions:
* Reset user password via email
* Function that pulls more than one row of data
* Example of a "High score" list.
* Anything else you would like to see added.

Spoiler

  • 2

#2 Joe H

Joe H

    GMC Member

  • GMC Member
  • 352 posts
  • Version:Unknown

Posted 25 April 2012 - 04:05 PM

This is a really great tutorial. The amount of documentation and the clear examples earned a +1 from me. Thanks for this, it was an unexpected find and will go a long way to helping further my understanding of using a database with GM.

This should be considered for Staff Choice IMHO.
  • 0

#3 jmorrissey

jmorrissey

    GMC Member

  • New Member
  • 23 posts

Posted 02 May 2012 - 04:25 AM

This is a really solid walkthrough. It covers every step you'll need to know, including what to do on your server when setting up the MySQL database. It's well worth downloading for anyone wanting to be able to read and save data from a website for save/load game information.
  • 0

#4 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16791 posts
  • Version:GM:Studio

Posted 06 May 2012 - 09:02 PM

Excellent Tutorial. I´m moving this to the Staff Pick...
  • 0

#5 Lordfef

Lordfef

    GMC Member

  • GMC Member
  • 163 posts
  • Version:GM:Studio

Posted 12 August 2012 - 01:55 PM

Excellent Tutorial. I´m moving this to the Staff Pick...


I agree, very useful! good job. Thank you very much for this.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users