Answer the question
In order to leave comments, you need to log in
After a time, the picture is drawn in the canvas. What is the problem?
I upload an image to the server via a form
if($_FILES['stImage']['error'] == 0) {
if ($_FILES['stImage']['type'] == "image/jpg" ||
$_FILES['stImage']['type'] == "image/png" ||
$_FILES['stImage']['type'] == "image/gif" ||
$_FILES['stImage']['type'] == "image/bmp" ||
$_FILES['stImage']['type'] == "image/jpeg") {
move_uploaded_file($_FILES['stImage']['tmp_name'], 'upl/'.$_FILES['stImage']['name']);
}
}
$stImage = 'upl/'.$_FILES['stImage']['name'];
var steamIcon = new Image();
steamIcon.src = '<?php echo $stImage ?>';
steamIcon.onload = function() {
Icon.drawImage(steamIcon, 14, 14, 64, 64);
}
Answer the question
In order to leave comments, you need to log in
move_uploaded_file($_FILES['stImage']['tmp_name'], 'upl/'.$_FILES['stImage']['name']);
steamIcon.src = '...';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question