-function run_php() {
- chdir('../..');
- $html_file = $_SERVER['REDIRECT_URL'];
- $html_file = ereg_replace('.*/', '', $html_file);
- $php_file = ereg_replace('\.html$', '.php', $html_file);
+function run_php($basename = false) {
+ if($basename) {
+ $html_file = "$basename.html";
+ $php_file = "$basename.php";
+ } else {
+ $html_file = $_SERVER['REDIRECT_URL'];
+ $html_file = ereg_replace('.*/', '', $html_file);
+ if($html_file == '') {
+ $html_file = 'index.html';
+ }
+ $php_file = ereg_replace('\.html$', '.php', $html_file);
+ }