index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<form action="imagem.php" method="post" enctype='multipart/form-data'>
<input type="file" id="foto" name="foto" />
<input type="submit" value="Enviar" />
</form>
</body>
</html>
imagem.php
<?php
preg_match("/\.(gif|bmp|png|jpg|jpeg){1}$/i", $_FILES['foto']['foto'], $ext);
$imagem_nome = md5(uniqid(time())) . "." . $ext[1];
rename($_FILES['foto']['tmp_name'], "/tmp/" . $imagem_nome);
$postData = array();
$postData['fileupload'] = "@/tmp/" . $imagem_nome;
$postData['submit'] = "Submit";
$postData['key'] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$postData['rembar'] = "yes";
$postData['xml'] = "yes";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.imageshack.us/index.php");
curl_setopt($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_TIMEOUT, 240);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData );
$response = curl_exec( $ch );
curl_close($ch );
echo $response;
?> eu gostaria invés de upar uma imagem do meu pc eu pegaria uma imagem da internet redimencionar para 250x250 colocar uma marca d'agua em .png e upar no imageshack esse codigo upa uma imagem do meu computador para o imageshack e possivel fazer o que eu quero? Obrigado