bluwe Posted November 18, 2006 Share Posted November 18, 2006 Hi,is it possible to pass a variable from a php script to a included .php file? For example:<?$customerid = 69;include test.php;?>How do I get the variable into test.php shoul I use GET?Cheers Link to comment https://forums.phpfreaks.com/topic/27727-passing-variables-around/ Share on other sites More sharing options...
JasonLewis Posted November 18, 2006 Share Posted November 18, 2006 i thought it was possible or though i have never tested it myself. you should be able to just call the variable as normal from test.php. make a test page or soemthing. do what you have done above but in test.php make an if statement to check if customerid is 69, if it is echo yes if it isnt echo no. just see what it does.because i think it would work. Link to comment https://forums.phpfreaks.com/topic/27727-passing-variables-around/#findComment-126816 Share on other sites More sharing options...
bluwe Posted November 18, 2006 Author Share Posted November 18, 2006 I got it to work as a test - must be a mistake in my code! Thanks for your help!! Link to comment https://forums.phpfreaks.com/topic/27727-passing-variables-around/#findComment-126820 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.