So, I've got a variable that is set when an array returns a value that is identical to a strong. it's the most complex thing I've dealt with. Now, I've just got one more goal.
See, my site is a Wordpress site. all these calculations are taking place in the header, but the code I want changed is in the footer. The answer I seem to draw, is that I need to make the variable into a global variable. I've been trying for a few hours, but I can't seem to get it right.
Can someone tell me what I need to do? I've tried solutions seen in other questions on here, but no solutions seem to work for me.
here is the code for the header. With this site, it broaches a popular series' core communities. To ensure the site remains largely undiscovered until launch, I've changed some URLs and IDs!
$message_array = file("http://www.example.com/wp-content/themes/mytheme/Subtitles.css", FILE_IGNORE_NEW_LINES);
$message = array_rand($message_array);
$GfCheck = '<audio id="audio" src="http://www.example.com/wp-content/uploads/2016/01/example.wav" preload="auto" ></audio><a onclick="test()"><img src="http://example.com/wp-content/uploads/2016/01/Gf.png" height="90px" alt="test" title="test"/></a>';
if ($message_array[$message] == $GfCheck) {
$Gf = "1";
$GLOBALS['Gf']
}
else { }
echo "$message_array[$message]";
And here is the code I have in the footer
if($GLOBALS['Gf']) {echo "Text to add to footer"; } ?>
It is worth noting, the second I add the $GLOBALS to the header, any tests I have in there (my test to make sure the code actually detected the correct line) cease functioning, indicating the variable stops working. As such, the code as I've presented does not work, but if I remove the globals tag, it does work perfectly for the header alone. any idea what I can do?