Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/03/2005, 15:24
guja
Invitado
 
Mensajes: n/a
Puntos:
Exclamación Por favor, necesito ayuda con este tema!!

Hola a todos, tengo el siguiente problema, estoy tratando de levantar una imagen desde un archivo, y cuado la quiero mostrar me tira un montón de caracteres irreconosibles, que me está faltando o que estoy haciendo mal??
El codigo es el siguiente:

<?php
// In PHP 4.1.0 or later, $_FILES should be used instead of $HTTP_POST_FILES.
function imagen(){
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
createim($_FILES['userfile']['name']);
/*copy($_FILES['userfile']['tmp_name'], "/images/untitled");*/
} else {
echo "No fue posible abrir el archivo. Filename: " . $_FILES['userfile']['name'];
}
}
function createim($imagename){
$im = imagecreatefromjpeg("images/".$imagename);
//$px = imagesx($im);
//header("Content-type: image/jpeg");
imagejpeg($im);
imagedestroy($im);
echo "images/".$imagename;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form enctype="multipart/form-data" action="" method="post"><?php imagen(); ?>
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file:
<input name="userfile" type="file">
<input name="Enviar" type="submit" value="Send File">
</p>
<p>
<input type="text" name="textfield">
</p>
</form>
<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1; left: 339px; top: 86px;">
</div>
</body>
</html>