Jump to content

variables


reportingsjr

Recommended Posts

First, GET isn't a function, in PHP it's just a variable.Anyway, is there a particular reason you don't want to use it? Your alternatives are to either store everything in the session, or to store just an ID number in the session, and store all of the information in a database or a file, and look it up using the ID in the session. Depending on what you're doing, you could also create and submit a form using javascript, but that obviously wouldn't work if javascript was disabled.

Link to comment
Share on other sites

SESSIONs are also possible, they are just like POST and GET superglobals. They work the same, only session variables must be manually set with a constructor, and the session itself must be initiated at the very beginning of every page that takes part. :)Session variables are kept the entire session, that ends after a period of inactivity of the user. There will be stored a cookie at the user's cache, that holds the session ID. The server then searches every session start folr present IDs, and continues that session. :)

Link to comment
Share on other sites

Well, im trying to create a text-based game.. and I need it to go through a login page, then it goes to the play.php page. I would like it to display the persons name.. sorry, I meant the get superglobal..so the form has already ben used. do I really have to use a session? If so ill just do it quickly now..

Link to comment
Share on other sites

The two ways to pass data around between a lot of pages are either through the querystring (get) or sessions. That's really the only way to do it, even if you use a database or a storage file you still need to pass an ID around through either the querystring or a session.Or you could make every single link a form that submits the stuff through post, but that might be a pain. Most of the time when you pass login info, you do it through the session.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...