Fredrik Brandt - 2017-10-25 03:37:33 -
In reply to message 2 from Vivek moyal
Hi,
By second kolumn I mean:
Kol 1 Kol 2
Registration of name etc. Take a picture
on several lines Display of picture with image name
I have these entries in my index.php-file.
I don't have a table called snapshot,
I have a table on my own where I want to update the image
(how is it possible later on to show the picture?).
I also have a visitcard where I want to put the image to print
(in styled place on the card).
In my index.php I have:
...
<script type="text/javascript">
function PrintDiv() {
var divToPrint = document.getElementById('visitcard');
var popupWin = window.open('', '_blank', 'width=300,height=300');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">'
+ '<img src="./images/logo-lexicon_30.gif">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
...
<!-- Show visitcard -->
<div class="card" id="visitcard">
<?php echo "";?><br>
<?php echo "";?><br>
<?php echo $firstname;?><br>
<?php echo $lastname;?><br>
<?php echo $course;?><br>
<?php echo $frdate;?><br>
<?php echo $todate;?>
<!-- <?php echo "<img src='".$image."'>";?> -->
</div>
<form>
<input type="button" name="print" value="Print" onclick="PrintDiv();" />
</form>
...
//-- Insert
$data = 1; //$image; //file_get_contents($_FILES['image']['tmp_name']);
$sql = "INSERT INTO " . $tbname . " (
firstname, lastname, image, course, frdate, todate, email)
VALUES ('$firstname','$lastname','$data','$course','$frdate','$todate','$email')";
if (mysqli_query($conn, $sql)) {
//echo "New record created successfully. <br>";
} else {
//echo "Error: " . $sql . "<br>" . $conn->error . " <br>";
}
Greatful for help :).
I have tried to modify the webcamClass.php (saveImageToDatabase)
with f.ex. trying to set an environment variable that I later on reads from index.php without any luck.
I want to use the $image (or $imageurl) from here that I have taken.
(Besides, if I take another picture it will display beneath the previous taken picture and so on, and I only want one to be displayed. How can this be avoided?)
Regards,
/Fredrik.