Server IP : 103.233.192.212 / Your IP : 18.218.54.80 Web Server : Apache/2 System : Linux sv1.inde.co.th 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 User : sumpatuan ( 1058) PHP Version : 5.5.38 Disable Function : symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,putenv,passthru,escapeshellarg,escapeshellcmd,pcntl_exec,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,ini_restore MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/sumpatuan/domains/sumpatuan.go.th/MPDF54/examples/ |
Upload File : |
<?php if ($_REQUEST['filename']) { $filename = $_REQUEST['filename']; } else { die("No file specified"); } include("../mpdf.php"); $mpdf=new mPDF('utf-8-s'); $mpdf->debug=true; $mpdf->tabSpaces = 6; $mpdf->allow_charset_conversion=true; $mpdf->charset_in='windows-1252'; //============================================================== preg_match('/example[0]{0,1}(\d+)_(.*?)\.php/',$filename,$m); $num = intval($m[1]); $title = ucfirst(preg_replace('/_/',' ',$m[2])); if (!$num || !$title) { die("Invalid file"); } if (preg_match('/\//', $filename) || !preg_match('/\.php$/',$filename)) { die("Hacking attempt"); } $html = ' <h1>mPDF</h1> <h2>Example '.$num.'. '.$title.'</h2> <div style="border:1px solid #555555; background-color: #DDDDDD; padding: 1em; font-size:8pt; font-family: lucidaconsole, mono;"> '; $lines = file($filename); $html .= '<pre>'; foreach($lines AS $line) { $html .= htmlspecialchars($line); } $html .= '</pre>'; $html .= '</div>'; $mpdf->WriteHTML($html,2); // The 2 is important to prevent <style etc. being parsed $mpdf->Output(); exit; //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== ?>