i'm trying to pass variables from userInfo.php to flips.php but for some reason the variables don't go through.
When i do echo "hello"; in the userInfo.php then i do see 'hello' in the website but when i do:
if (isset($variable)) {
echo "it is set!";
} else {
echo "nope!";
}
Then it returns 'nope!' even though i have set $variable in userInfo.php.
userInfo.php:
<?php
$variable = "hello everyone!";
echo "hello!";
flips.php:
<?php
include ('userInfo.php');
if (isset($variable)) {
echo "it is set!";
} else {
echo "nope!";
}
Website output:
hello!nope!
what am i doing wrong so flips.php doesn't see $variable?
Edit (the real code from my website):
flips.php:
include ('../csgodonut/application/views/steamauth/userInfo.php');
if (isset($steamprofile["personaname"])) {
echo "yes!";
} else {
echo "nope..";
}
userInfo.php:
$steamprofile['personaname'] = "Smokey";
echo "test";
Website: www.csgodonut.com (you have to login to steam in order to see the hello! nope..)
flips.php location: csgodonut/application/views/gebruiker/home/flips.php
userInfo.php location: csgodonut/application/views/steamauth/userInfo.php
$variableis called$steamprofilein my code, other then that it is exactly the same<?php? seems unlikley<?phpis in my codeinclude pathanywhere? You ought to check the include path usingget_include_path()&/or set withset_include_path()- maybe also check inflips.phpwhat files have been included withvar_dump(get_included_files());~ or try withrequireto see any errors it may throw