File: cgiclient.php

package info (click to toggle)
libqxt 0.6.1-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 19,004 kB
  • sloc: cpp: 57,512; xml: 296; sh: 251; makefile: 56; php: 14
file content (18 lines) | stat: -rwxr-xr-x 546 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/php-cgi
<?php
if(empty($_SERVER['PATH_INFO']) || $_SERVER['PATH_INFO'] == '/') {
    $_SERVER['PATH_INFO'] = "/index.php";
} elseif($_SERVER["PATH_INFO"][0] != '/') {
    $_SERVER["PATH_INFO"] = '/'.$_SERVER["PATH_INFO"];
}
chdir(dirname("/var/www/html$_SERVER[PATH_INFO]"));
if(strstr($_SERVER['PATH_INFO'], ".php")) {
    include_once("/var/www/html$_SERVER[PATH_INFO]");
} else {
    if(strstr($_SERVER['PATH_INFO'], ".css")) {
        header("Content-type: text/css");
    }
    readfile("/var/www/html$_SERVER[PATH_INFO]");
}

?>