AbydosGater Posted December 7, 2006 Share Posted December 7, 2006 Hi,In my sites config file i have all my database variables and such as follows...[code]<?php//There is more im only posting the following...$sfversion = "2.0";require("common.php");?>[/code]And i know that variable is being set, i can echo it on a page...But in my common.php i have a function that displays the site stats as follows...[code]echo "Current Alert: <font color='$alertcolour'>$alertcolour</font><br>SF Version: $sfversion<br>Members: $num_users<br>Admins: $num_admins<br>Online: $num_users_online<br>";[/code]And its all working fine except its not displaying the version var, did i spell something wrong? whats am i doing wrong? or is this a big problem?Abydos Link to comment https://forums.phpfreaks.com/topic/29853-either-a-big-problem-or-a-small-mistake/ Share on other sites More sharing options...
artacus Posted December 7, 2006 Share Posted December 7, 2006 If you are echoing this from inside a function, it won't be in the function's scope unless you use "global" Link to comment https://forums.phpfreaks.com/topic/29853-either-a-big-problem-or-a-small-mistake/#findComment-137156 Share on other sites More sharing options...
AbydosGater Posted December 7, 2006 Author Share Posted December 7, 2006 Lmao how the hell did i forget that :PThanks mate Link to comment https://forums.phpfreaks.com/topic/29853-either-a-big-problem-or-a-small-mistake/#findComment-137158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.