Transmitting data across webpages (HTML and PHP question)
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Transmitting data across webpages (HTML and PHP question)
Hi,
For a page I'm making, there'll be a "make a friend" link, upon clicking which, the user will be taken to a login page, so that they can authenticate themselves (i.e. WHO wants to make a friend). I want the link to be processed by a "makefriendlogin.php" script which will have "person" as an argument, ie. makefriendlogin.php?person=26 (the number comes from a database, don't worry about it). My question is, how do I write the makefriendlogin.php script, so that the "author" argument will be available to the "makefriend.php" script that'll actually do the authenticating for the user when they enter their name and password?
The concept works like this: a single token is placed into a cookie or hidden field of all pages in the application. The (unique) value of the token is an index/key to the full complement of session-specific data, and is use on the server as a way to locate all of the session-specific data on the server (in, for instance, a relational database).
The method of encoding the session key is implementation-specific. PHP Sessions is an example of such use of data persistence. You are free to contrive your own methods.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.