Passing variables without a form.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Passing variables without a form.

Post by php_wiz_kid »

How do I pass a variable without having to go through a form. I just want to be able to click on a link and be able to display the values of the previous page without having to use form objects. Hidden forms just aren't practicle either. Thanks.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

GET style URL mangling, cookies, or sessions.
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

What do you think the most secure way of doing this?
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Any or all can be made secure. I personally prefer cookies or sessions; I dislike name-mangling as it makes for ugly urls, however, it does allow for customizations of what data from one page is passed to the next.

Sessions are definately more convienent, in m opinion, as you are only passing one piece of information around (the sessionid) with the other values staying on the server only, indexed by the sessionid. However the sessionid needs to be protected.

I suggest using a MAC (Message Authentication Code) on all values to be sent across the network. (For more information do a search for posts by me (nielsene) and the words MAC or security...
Post Reply