Demonic Posted April 16, 2007 Share Posted April 16, 2007 function PresetApps($content) { include_once("*****/*****/settings.php"); $Settings = new Settings;//New settings class - gets the CleanString function! include_once("*****/******/applets.php"); $Applets = new Applets;//New settings class - gets the CleanString function! $tag = array( '/\[uSERS_ONLINE\]/is', '/\[sTATS\]/is', '/\[uSER_CONTROLS\]/is', '/\[NEWS\]/is', '/\[sEARCH\]/is', '/\[FILE=(.*?)\]/e', ); $feature = array( "". $Applets->UsersOnline() ."", "". $Applets->GetStats() ."", "". $Applets->UserControlsApp() ."", "". $Applets->LatestNews() ."", "". $Applets->SearchBox() ."", "''. $Applets->ExternalFile('\\1') .''", ); $string = preg_replace($tag, $feature, $content);//Return the content return $string; } Alright in the SQL there is a [FILE=ads] and it would include the file and output whats in the file. ads.php function ads(){ echo "This is a test"; } ads(); So when the script is ran The box is working but the only thing that isn't working is the class: It outputs "ads" and not the actual function that should output "This is a test" It seems like its only echoing the regular expression and ignoring the class that is being called. How do I fix this?: function ExternalFile($file) { include_once("*****/*****/settings.php"); $Settings = new Settings; $Settings->GetInfo(); include($Settings->url."applets/".$file.".php"); } (this file is inside a class) Can someone help me fix this error so it makes the class initiate the function. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/47175-the-output-of-this-regular-expression-isnt-right/ Share on other sites More sharing options...
btherl Posted April 16, 2007 Share Posted April 16, 2007 That's pretty complex. If I was debugging it, I would add print/echo statements all throughout the code you are interested in, to make sure the values are correct at every stage. That should help you find the problem. Link to comment https://forums.phpfreaks.com/topic/47175-the-output-of-this-regular-expression-isnt-right/#findComment-230061 Share on other sites More sharing options...
Demonic Posted April 16, 2007 Author Share Posted April 16, 2007 I have been doing that. The Box shows. Then if I try any other way it will echo either "\1" or "$1" or "\$1" and thats why im getting very frustrated been trying to debug for last 2 hours so I came here . Link to comment https://forums.phpfreaks.com/topic/47175-the-output-of-this-regular-expression-isnt-right/#findComment-230065 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.