-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
35 lines (32 loc) · 980 Bytes
/
example.php
File metadata and controls
35 lines (32 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include "html-jpg-parser.php";
if (@$_POST['sitecont']) {
$unedited_contents = $_POST['sitecont'];
$image_edited_contents = htmlImagesToFilesAndResize($unedited_contents, 640,480);
echo $image_edited_contents;
}
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<title>HTML - JPG - Parser example</title>
<script>
function subm() {
document.getElementById("sitecont").value = document.getElementById("contents").innerHTML;
document.getElementById("contform").submit();
}
</script>
</head>
<body>
<form id="contform" action="example.php" method="post">
<input type="hidden" name="sitecont" id="sitecont">
<button onclick="subm()" value="submit">Submit</button>
</form>
<div id="contents" style="min-width:100px;min-height:100px;background:#aaa;" contenteditable>
Add jpg image here (drag&drop) and click Submit
</div>
</body>
</html>