PROBLEM
1) If I declare variables in 1.php - that's the script to which I submit the form, and start another 2.php script trough Header - command, are the variables entered in the 1.php still functional in the 2.php or do I need to declare them again, and if possible the code for that (3 Variables, no more), 2.php will query the database
Thanks ahead
[S] Variables and carrying them trough several php scripts
Moderator: General Moderators
[S] Variables and carrying them trough several php scripts
Last edited by Calimero on Tue Jul 27, 2004 2:11 am, edited 1 time in total.
- AVATAr
- Forum Regular
- Posts: 524
- Joined: Tue Jul 16, 2002 4:19 pm
- Location: Uruguay -- Montevideo
- Contact:
if you want to use a variable in many pages using header.. you have to
1- you use a url like: http://www.myurl.com\page.php?variable=content
and you retreive the content use get method ($_GET variable)...
2- using sessions.. ($_SESSION). you store de variable in a variable session in page 1.php ($_SESSION['myvariable'] = value) and you retreive the value in page 2 with $_SESSION['myvariable'] (you have to session_start(); in the first line of each page.

1- you use a url like: http://www.myurl.com\page.php?variable=content
and you retreive the content use get method ($_GET variable)...
2- using sessions.. ($_SESSION). you store de variable in a variable session in page 1.php ($_SESSION['myvariable'] = value) and you retreive the value in page 2 with $_SESSION['myvariable'] (you have to session_start(); in the first line of each page.