Jump to content

The output of this regular expression isn't right.


Demonic

Recommended Posts

	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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.