Hi have uploaded a PHP file on the server. When reaching that url using a browser, for example
mysite.com/test.php
I see the code (content) of the PHP file and the script seems not running.
SERVER IS F5 BIG-IP Apache
Could you point me out what could be the error?
<?php
$url = rawurldecode($_GET['proxy_url']);
$cb = ! empty($_GET['callback']) ? $_GET['callback'] : null;
if(preg_match('#xxx\.xxx\.com/xxx/#', $url)){
$url = preg_replace('#http\://xxx\.xxx\.com/xxx/#', '', $url);
}
if(! preg_match('#^https?:#', $url)){
$url = preg_replace('#^[\.\/]+#', '', $url);
if(!file_exists($url)){
echo 'File not found';
die(0);
}
}
if(preg_match('#\.xml$#', $url)){
header('Content-type: text/xml');
}
$file = file_get_contents($url);
if($cb){
header('Content-type: application/javascript');
echo $cb.'('.$file.');';
}else{
echo $file;
}