<?php
//$db = mysqli_connect("localhost", $login,$dbpass,$dbname);
$db = mysqli_connect('localhost', 'root', '', 'multi_login');
session_start();
?>
<?php
$errorCorrectionLevel = 'L';
$matrixPointSize = 4;
if($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['verify_btn'])):
/*
echo "<pre>";
print_r($_POST);
echo "</pre>";
*/
//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';
/////////////////////////////////////
if (isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L','M','Q','H'))):
$errorCorrectionLevel = $_REQUEST['level'];
endif;
if (isset($_REQUEST['Pointsize'])):
$matrixPointSize = min(max((int)$_REQUEST['Pointsize'], 1), 10);
endif;
if((!empty($_REQUEST['property_type']) && in_array($_REQUEST['property_type'], array('TBA1','TBA2','TBA3'))) && !empty($_REQUEST['location']) && !empty($_REQUEST['size'])):
$data = 'Property Type: ' .$_REQUEST['property_type']."\n";
$data .= 'Location: ' .$_REQUEST['location']."\n";
$data .= 'Size: ' .$_REQUEST['size']."\n";
$filename = $PNG_TEMP_DIR.'test'.md5($data.'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
QRcode::png($data, $filename, $errorCorrectionLevel, $matrixPointSize, 2);
endif;
/*
$imgData = addslashes(file_get_contents($filename));
$imageProperties = getimageSize($filename);
$sql = "INSERT INTO trial (imageType ,imageData, user_id)
VALUES('{$imageProperties['mime']}', '{$imgData}','".$_SESSION['id']."')";
mysqli_query($db, $sql) or die("<b>Error:</b> Problem on Image Insert<br/>" . mysqli_error($db));
$current_id = mysqli_insert_id($db);
*/
$imgData = file_get_contents($filename);
$imageProperties = getimageSize($filename);
$sql = "INSERT INTO property (imageType ,imageData, user_id, property_id,location,size) VALUES(?,?,?,?,?,?)";
$query = $db->prepare($sql);
$query->bind_param("ssisss", $imageProperties['mime'], $imgData, $_SESSION['id'],'$property_id','$location','$size');
$query->execute();
$current_id = $query->insert_id;
//Optional removal of physical temp image
unlink($filename);
endif;
?>
<form method= "post" action="">
<div class="container mt-3">
<label><i class="fa fa-building"></i>Property Type</label>
<select name="property_type" class="form-control" required ="required" >
<option value="" > ~ Select Address ~ </option>
<option value="TBA1">TBA1</option>
<option value="TBA2">TBA2</option>
<option value="TBA3">TBA3</option>
</select>
</div>
<div class="container mt-3">
<label><i class="fa fa-map-marker"></i>Location</label>
<input type="text" name="location" class="form-control" required ="required">
</div>
<div class="container mt-3">
<label>Size</label>
<input type="text" name="size" class="form-control" required ="required">
</div>
<div class="mb-3 mt-3">
<button type="submit" class="btn btn-primary" name="verify_btn">Submit</button>
</div>
</form>
Fatal error : Uncaught Error: Cannot pass parameter 5 by reference in C:\xampp\htdocs\ims\admin\new2.php:66 Stack trace: #0 {main} thrown in C:\xampp\htdocs\ims\admin\new2.php on line 66