-2

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;
}
GibboK
  • 71,848
  • 143
  • 435
  • 658

3 Answers3

0

close php tag and check does server support php

Nikolaj Sarry
  • 245
  • 7
  • 18
0

Your server is not setup to parse PHP scripts, check that it has PHP installed

Husman
  • 6,819
  • 9
  • 29
  • 47
0

Have you installed PHP? - If so do the following:

  1. Start off by trying a simple script - call it say info.php:

  2. Ensure (assuming Apache) that you have it the web server configured - see http://php.net/manual/en/install.php

If all this works then there is a problem with the script.

Ed Heal
  • 59,252
  • 17
  • 87
  • 127