Quisiera pedirles el favor de ayudarme a unir estos dos codigos
Código PHP:
<?php
$filename = date('YmdHis') . '.jpg';
$result = file_put_contents( $filename, file_get_contents('php://input') );
if (!$result) {
print "ERROR: Failed to write data to $filename, check permissions\n";
exit();
}
$url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . $filename;
print "$url\n";
?>
Código PHP:
<?php
if(!empty($_FILES['image']) && $_FILES['image']['error'] == UPLOAD_ERR_OK) {
require_once 'ModifiedImage.php';
$image = new ModifiedImage($_FILES['image']['tmp_name']);
$original = 'original_' . $_FILES['image']['name'];
/**
* Position: middle center
* @see setPositionWatermark
*/
$image->imgWatermark('http://www.forosdelweb.com/w/skins/common/images/wiki.png', 30, 'middle center', 0, 0);
$image->save($original);
?>