--- trunk/www/working/printable.php 2010/09/19 19:59:59 130
+++ trunk/www/working/printable.php 2010/09/20 18:49:07 131
@@ -9,17 +9,27 @@
// error_reporting(E_ERROR);
ini_set('display_errors', '1');
-//
-// trunk or demo are the local folders used to develop
-// this file at my own private apache server
-//
-$pageUrlName=basename ($_SERVER['HTTP_REFERER']);
-if ( $pageUrlName == 'clonezilla-sysresccd.hellug.gr' OR $pageUrlName == "localhost" OR $pageUrlName == "demo" OR $pageUrlName == "trunk" ) $pageUrlName='index.html';
-$eReg="{#.*}";
-$onlyURL=preg_replace($eReg,"",$pageUrlName);
-// echo "pageUrlName = $pageUrlName";
-
-$thePage = getcwd() . '/' . basename ($_SERVER['HTTP_REFERER']);
+$curPage = basename( $_SERVER["REQUEST_URI"] );
+// echo "pageURL = $curPage
";
+if (substr($curPage,0,14) == "printable.php?" ) {
+ //
+ // This means we have a printable.php?xxx.html URL
+ // let's get the xxx.html part
+ //
+ $pageUrlName = substr( $curPage,14,strlen($curPage) );
+ // echo "pageUrlName = $pageUrlName
";
+} else {
+ //
+ // trunk or demo are the local folders used to develop
+ // this file at my own private apache server
+ //
+ $pageUrlName=basename ($_SERVER['HTTP_REFERER']);
+ if ( $pageUrlName == 'clonezilla-sysresccd.hellug.gr' OR $pageUrlName == "localhost" OR $pageUrlName == "demo" OR $pageUrlName == "trunk" ) $pageUrlName='index.html';
+ $eReg="{#.*}";
+ $onlyURL=preg_replace($eReg,"",$pageUrlName);
+ // echo "pageUrlName = $pageUrlName
";
+ $thePage = getcwd() . '/' . basename ($_SERVER['HTTP_REFERER']);
+}
$thePage = getcwd() . '/' . $pageUrlName;
// echo "thePage = $thePage
";