0

The title may explain the gist of it, but I want to know something. I am new to coding in PHP, and am adding it alongside my HTML5 so I can create a website for a game I'm creating. But, I need to know if I can permanently and dynamically change the contents of a file within an FTP.

So, say if I had 2 array values in a Username and Password field when I first created it. Is there any possible way to create a function that, upon registering information, allows me to permanently add those array values, so that every time I open the file, it stays at three values?

I want to do this so that I have a simple login system created. If there are any questions that have what I'm looking for in PHP, feel free to close as a duplicate and point me in the right direction. This is my first step, and I hope I can get some help on it. Thanks again in advance.

Kashiki
  • 29
  • 2
  • 6
  • 1
    Look at sessions. They're the basics you'll need. http://us1.php.net/manual/en/session.examples.basic.php – Armel Larcier Dec 15 '13 at 16:50
  • You should look at some example login systems. Everything is stored in memory for the current script, so it is wiped out at the end. You can use sessions or cookies to save information about the current client/session. – Devon Bessemer Dec 15 '13 at 16:51
  • "PHP will populate the $_SESSION superglobal with any session data after the session has started. When PHP shuts down, it will automatically take the contents of the $_SESSION superglobal, serialize it, and send it for storage using the session save handler." This is exactly what I need. Thank you. – Kashiki Dec 15 '13 at 16:55

0 Answers0