Hi,
I have for example 2 php pages, page1.php and page2.php. On the page1.php i have a variable $path, which has a dir path in it. I need this variable in the page2.php. How can i send it? i Can't use include "page1.php" in the page2.php.
thanks, this site has helped alot during my development :)
Help with variables.
Moderator: General Moderators
see this post viewtopic.php?t=6521
for example
page1
page 2
[php<?php
session_start();
echo '$_SESSION[username] equals '.$_SESSION['username'];
echo '<br><br><a href="page3.php">Go to page 3</a>';
?>
hope this helps
for example
page1
Code: Select all
<?php
<?php
session_start();
if ( !isset($_SESSION['username']) ) {
$_SESSION['username'] = 'jason';
}
echo '$_SESSION[username] equals '.$_SESSION['username'];
echo '<br><br><a href="page2.php">Go to page 2</a>';
?>
?>page 2
[php<?php
session_start();
echo '$_SESSION[username] equals '.$_SESSION['username'];
echo '<br><br><a href="page3.php">Go to page 3</a>';
?>
hope this helps