How to Pass variables between pages

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
mariolopes
Forum Contributor
Posts: 102
Joined: Sun May 22, 2005 7:08 am

How to Pass variables between pages

Post by mariolopes »

Hi
I know one way of passing variables between pages with session variables. Is the best option? How about using hidden fields in html? One question if i have one form i have to have one submit button or i can move to another page with the command header (Location....)
Thank you
mario
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: How to Pass variables between pages

Post by social_experiment »

I heard of the hidden field method, im just not sure how secure it is, well it depends on what you wish to send.

The form (page) has to be submitted, im not sure how headers() would work in such an instance.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply