Login

fightjunkie01@hotmail.comfightjunkie01@hotmail.com Member, PRO Posts: 60
edited April 2014 in Working with GS (Mac)

First off I am Pro, so you don't need to tell me I gotta be pro! :)

Ok, How can I make a login button that logs the user into their account on my website.

Also, A logout button

Comments

  • colandercolander Member Posts: 1,610

    Use the Open URL behaviour under the Pro tab to take the user to your website form their they can login and log out themselves.

  • fightjunkie01@hotmail.comfightjunkie01@hotmail.com Member, PRO Posts: 60

    I want the login to open two new boxes where they input there username and password to my site and it logs them in.. I don't want the open Url behavior

  • colandercolander Member Posts: 1,610

    I don't think what you are asking for can be done with GS, others might know better. As far as I am aware the Open Url Behaviour is all GS has and as far as i know it won't accept any further code to do the last bit you want.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited April 2014

    Hi fightjunkie01

    (I replied via PM as well, but saw you'd posted here and thought I'd share here too)

    Ok, this is possible but its far from easy. I'm still working on my own setup for registration and login and I've been doing it for 3 months (between 1 and 4 hours a day).

    forums.gamesalad.com/discussion/64039/creating-your-own-asynchronous-server/p1

    To do it you make use of the SEND and RECEIVE URL Pro behaviors.

    SEND:
    This collects up a table that exists in GameSalad and sends it as a JSON file to a given address. The given address should be to a file on your server (local test server, or live server on the internet). The file on your server will receive the file, convert it to a useable format, look at the data and decide what to do with it (i.e. verify it against info on a database, add it to a database, update a database, send out an email to a received address).

    RECEIVE:
    This sends a call from GameSalad to retrieve a JSON file from a given file on your server. Where the file will build up a JSON file with the data you want.

    @jonmulcahy created a great tutorial as an introduction to the above behaviors and supplied some handy code to use as a foundation.
    http://forums.gamesalad.com/discussion/63636/sending-and-receiving-data-using-your-own-sql-server-php-file-and-testproject-included/p1

    Jon Mulcahys files are setup to use mysql, this works really well. But it's worth noting that mySQL is being phased out slowly and eventually won't be supported by newer versions of PHP. So if you're going to learn how to do it you might as well learn a more up todate option like PDO or mySQLi (note the i). I looked at both options and went with PDO as it actually seemed easier to adapt from the older mySQL scripts I'd created/adapted so far.

    I started off working with Jon Mulcahys files and have adapted them an awful lot to get to what I've got now. I think I've got loooonnnnnggg scripts that handle my login, registration and initial game setup. (Sorry but not willing to share scripts at the moment, too much time invested, I might offer it in the future. But really it makes far more sense to build it yourself and understand what the hell is going on).

    I've found the need to learn a lot about PHP scripting, local testing servers, server database management mySQL, PDO, security (encryption), Amazon AWS (for potential cheap asynchronous game hosting). So all the things we did'nt want to do when first arriving at GameSalad, though I am sort of enjoying the journey so far. :-)

    So if you want to give it a go read up on all the above info and be prepared for a lot of time being invested into creating your setup.

    Good luck.

    Jon

Sign In or Register to comment.