Skip to main content
Inspiring
April 29, 2012
Question

where to start when writing a server?

  • April 29, 2012
  • 1 reply
  • 547 views

Ok ive made a simple login/CreateAccount system using as2 and i used cookies to save the infomation of the user.

Where would i start in wrighting a server or database where I could save the infomation of the user in there and how could I host this.

Ive have knolage in as2 and a bit in HTML, but ive got no knolage in servers or database's

so could you please give me some links and explain how this all works.

Heres my as2 login code if you need it.

It needs alot of patching but it is ok for now.

..........................................................................................................................................................................

var saveData:SharedObject = SharedObject.getLocal ("BoldonComputersAccount"); //Name of the cookie to be saved in

var Invalid:String = ""; //text file what pops up if the password is wrong

var InputPass:String = "";//the users input

var InputUser:String = "";//the users input

var Username:String = "";//there username

var Password:String = "";//there password

var Email:String = "";//there email not necessery

function Names(){//Change the username and password to new_username and new_password

Username = new_Username;

Password = new_Password;

Email = new_Email;

SaveInfo() //save the username and password and email if entered

}

function SaveInfo() :Void{ //the save function

   

     _root.saveData.clear ();  // clear current saved data

     

     // record variables

     _root.saveData.data.Username = _root.Username;

           _root.saveData.data.Password = _root.Password;

           _root.saveData.data.Email = _root.Email;

     

     // save as cookie (without using this method, the cookie will disappear after the current browser session)

     _root.saveData.flush ();

}

///// LOAD FUNCTION /////

function Login(){

     // load saved data

     _root.Username = _root.saveData.data.Username;

           _root.Password = _root.saveData.data.Password;

          

           if(_root.InputUser == Username && _root.InputPass == Password){//if the input is the same as the username and password then gotoandstop(5), there profile

                    _root.gotoAndStop(5)//there profile

           }else

           Invalid = "Wrong Password are username" //if the username or password is invalid

}

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
April 29, 2012

Here is a link to a tutorial regarding AS2/PHP/MySQL that might be helpful.  You may need to search for database-specific tutorials as well.

http://www.gotoandlearn.com/play.php?id=20

Inspiring
April 29, 2012

Thanks I will take a look now