Help - Search - Member List - Calendar
Full Version: passing variables between php pages
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
Hendry Taylor
if i have a.php and I define some variables, and I want to access these
variables from b.php but do not want to pass them via the url what
options do i have?

I am guessing 2 cookies or oject orientation useing classes?

Gnomo
The best method would be to have b.php include a.php using the includ
or require function.

This makes a.php part of b.php and then you can access the variables a
if they were defined in b.php

--
Gnom

"Your computer has too much computer in it, and not enough typewriter."

gcs/it$ d- s+: a--? c++ u* !p l++ e---- w+++ !n o? !k-? !w o? m++ v
!ps !pe y+ pgp t++ !5 x+ r+ tv+ b+ di+ d- g+ e(++) h* r+++ y
-----------------------------------------------------------------------
Gnomo's Profile: http://www.macosx.com/forums/member.php?userid=938
View this thread: http://www.macosx.com/forums/showthread.php?t=22466
macosx.com - The Answer to Mac Support - http://www.macosx.co

Denis WERNERT
If those variables should be able to change in time, you could try using
sessions.

Hendry Taylor wrote:

QUOTE
if i have a.php and I define some variables, and I want to access these
variables from b.php but do not want to pass them via the url what
options do i have?

I am guessing 2 cookies or oject orientation useing classes?



PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.