overlordofevil Posted June 5, 2008 Share Posted June 5, 2008 hey all, I am wondering if there is a way to share a variable between multiple files. What I mean by this is I have an interface that pulls data from a table and displays it based on what it is and how it is related to the user info. The user info in on the "main page" and the data being pulled is from another script that I have 'included'. so what I would like to do is take the user info and allow the included script to access it. Is there anyway to do this other then making the variable a session variable? any suggestion in where i can read up on this or what to try would be appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/108901-solved-how-to-quotsharequot-a-variable/ Share on other sites More sharing options...
craygo Posted June 5, 2008 Share Posted June 5, 2008 if you make a simple variable on one page it will be passed to the other as long as the included page is after the creation of the variable. Link to comment https://forums.phpfreaks.com/topic/108901-solved-how-to-quotsharequot-a-variable/#findComment-558662 Share on other sites More sharing options...
overlordofevil Posted June 5, 2008 Author Share Posted June 5, 2008 thats what I thought but for some reason it won't "transfer" to the other pages... hmmmm thanks for the help... Link to comment https://forums.phpfreaks.com/topic/108901-solved-how-to-quotsharequot-a-variable/#findComment-558665 Share on other sites More sharing options...
DarkWater Posted June 5, 2008 Share Posted June 5, 2008 Show us what you have and maybe we can help a bit more. Link to comment https://forums.phpfreaks.com/topic/108901-solved-how-to-quotsharequot-a-variable/#findComment-558669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.