Hendry Taylor
Jun 13 2005, 04:01 PM
If I have a php page that uses the header function to load a second php
page, how can I access variables defined in the first php page without
passing them via the url?
Andy Hassall
Jun 13 2005, 09:04 PM
On Mon, 13 Jun 2005 21:01:00 +0000 (UTC), Hendry Taylor
<[Email Removed]> wrote:
QUOTE |
If I have a php page that uses the header function to load a second php page, how can I access variables defined in the first php page without passing them via the url?
|
Cookies.
Sessions.
--
Andy Hassall / <[Email Removed]> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Lee David
Jun 14 2005, 12:32 AM
I looked up Sessions in PHP fasts&easy web development and they looked pretty hard on the surface. Can you expanded on their usage a little?
Thanks,
Lee
"Andy Hassall" <[Email Removed]> wrote in message news:[Email Removed]...
QUOTE |
On Mon, 13 Jun 2005 21:01:00 +0000 (UTC), Hendry Taylor <[Email Removed]> wrote:
If I have a php page that uses the header function to load a second php page, how can I access variables defined in the first php page without passing them via the url?
Cookies. Sessions.
-- Andy Hassall / <[Email Removed]> / <http://www.andyh.co.uk <http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool |
Chris Hope
Jun 14 2005, 12:37 AM
Lee David wrote:
QUOTE |
I looked up Sessions in PHP fasts&easy web development and they looked pretty hard on the surface. Can you expanded on their usage a little?
|
Did you try the manual? There's explainations there, examples and a lot
of user contributed notes.
http://www.php.net/manual/en/ref.session.php --
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Andy Hassall
Jun 14 2005, 06:00 PM
On Mon, 13 Jun 2005 20:32:00 -0500, "Lee David"
<[Email Removed]> wrote:
QUOTE |
I looked up Sessions in PHP fasts&easy web development and they looked pretty hard on the surface. Can you expanded on their usage a little?
|
There's not much to them, at least for basic usage.
You call session_start() on every page.
You set a value in $_SESSION on one page.
The same value is then available on the next page.
http://php.net/session--
Andy Hassall / <[Email Removed]> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Exyle
Jun 14 2005, 11:51 PM
It depends on how you're going to be accessing the files. a simple
include() might do, or you can just have your links to the toher file
include the variable:
<a href='b.php?var=<?php echo($var); ?>'>Link</a>
if those methods wont work, then you can use cookies and sessions.
Hendry Taylor wrote:
QUOTE |
If I have a php page that uses the header function to load a second php page, how can I access variables defined in the first php page without passing them via the url? |
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.