I am using ajax on a website that calls a php script that then parses another page and returns the part of the page that I want to display. I have used this technique in the past and it works well, except this time the part of the page that is being returned has some php code in it and it is being returned raw with out the php code being processed.
Here is the php script that is doing the parseing and returning the results.
require_once('simple_html_dom.php');
$dom = new simple_html_dom;
if(isset($_GET['url'])) {
$url = $_GET['url'];
$html = file_get_html($url);
/*get contents*/
$contents = $html->getElementById('content');
echo $contents;
}
As I mentioned what is being returned in $contents is being returned raw with out the php code inside the $contents string being processed, how can I get it to process the php code before returning the $contents string?
Thank you in advance for your help.