Tema: Unir codigo
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/09/2011, 05:13
david1467
 
Fecha de Ingreso: agosto-2010
Mensajes: 44
Antigüedad: 16 años, 2 meses
Puntos: 1
Unir codigo

Hola a tod@s.

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);
?>