jd2007 Posted July 16, 2007 Share Posted July 16, 2007 How do i take a variable from one php page to another ? let's say, i have a variable $c in 01.php...how do i access it from 02.php ? Link to comment https://forums.phpfreaks.com/topic/60192-how-do-i-take-a-variable-from-one-php-page-to-another/ Share on other sites More sharing options...
MasterACE14 Posted July 16, 2007 Share Posted July 16, 2007 include 01.php on 02.php: <?php include('01.php'); echo $c; ?> Regards ACE Link to comment https://forums.phpfreaks.com/topic/60192-how-do-i-take-a-variable-from-one-php-page-to-another/#findComment-299433 Share on other sites More sharing options...
jd2007 Posted July 16, 2007 Author Share Posted July 16, 2007 what if there are other things in php ? if they execute in 02.php, it will cause trouble...how do i prevent that ? Link to comment https://forums.phpfreaks.com/topic/60192-how-do-i-take-a-variable-from-one-php-page-to-another/#findComment-299435 Share on other sites More sharing options...
MasterACE14 Posted July 16, 2007 Share Posted July 16, 2007 name the variables different things, you cant have $c in page 01.php and on 02.php, you can only have $c on one of those pages not both if they are included. but separately you can. Regards ACE Link to comment https://forums.phpfreaks.com/topic/60192-how-do-i-take-a-variable-from-one-php-page-to-another/#findComment-299437 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.