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 ? Quote Link to comment 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 Quote Link to comment 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 ? Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.