Page 1 of 1

Help with variables.

Posted: Wed Mar 19, 2003 5:13 am
by mleskine
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 :)

Posted: Wed Mar 19, 2003 5:22 am
by deejay
see this post viewtopic.php?t=6521

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

Posted: Wed Mar 19, 2003 5:52 am
by mleskine
thanks, works well.