SJames Posted August 26, 2007 Share Posted August 26, 2007 I am having a problem with include() not taking any variables. For example, if I have the following two files, it won't print the variable. one.php <?php $a = "Text"; ?> two.php <?php include "one.php"; print $a; ?> The second file doesn't print "Text", it just remains blank. Quote Link to comment https://forums.phpfreaks.com/topic/66731-php-isnt-including-variables/ Share on other sites More sharing options...
trq Posted August 26, 2007 Share Posted August 26, 2007 Works as expected here. Is this the exact code your using? There is no setting which can turn this feature on/off. Quote Link to comment https://forums.phpfreaks.com/topic/66731-php-isnt-including-variables/#findComment-334384 Share on other sites More sharing options...
Ken2k7 Posted August 26, 2007 Share Posted August 26, 2007 Works for me when I do it. Quote Link to comment https://forums.phpfreaks.com/topic/66731-php-isnt-including-variables/#findComment-334385 Share on other sites More sharing options...
SJames Posted August 26, 2007 Author Share Posted August 26, 2007 This isn't exactly what I'm using, the real thing is really long. What I posted above doesn't work either though. Quote Link to comment https://forums.phpfreaks.com/topic/66731-php-isnt-including-variables/#findComment-334386 Share on other sites More sharing options...
Ken2k7 Posted August 26, 2007 Share Posted August 26, 2007 Well check your code. If the code never reach the statement to call that, then that's probably why. Try to print stuff out on the page to see if it ever stopped running. Quote Link to comment https://forums.phpfreaks.com/topic/66731-php-isnt-including-variables/#findComment-334387 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.