Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/07/2010, 20:46
Avatar de frankjoel86
frankjoel86
 
Fecha de Ingreso: noviembre-2008
Ubicación: Ica
Mensajes: 295
Antigüedad: 15 años, 5 meses
Puntos: 0
Sonrisa establecer tamaño en imagenes subidas

saludos gentita, estoy en pininos de php. dejo el codigo.

nueva_noticia.php
------------------------

<?php
session_start();
?>
<form name="form1" method="post" enctype="multipart/form-data">
Titulo:
<input type="text" name="Titulo" />
Noticia
<textarea name="Noticia" cols="30" rows="10" ></textarea>
Imagen1:
<input type="file" name="Imagen1" />
<br />
Imagen2:
<input type="file" name="Imagen2" />
<br />
Imagen3:
<input type="file" name="Imagen3" />
<input name="cmdenviar" type="button" onClick="javascript:validar()" id="cmdenviar" value="Ingresar"/>
</form>


insertar_noticias.php
----------------------------
<?php
session_start();
require("cn.php");

$titulo=$_POST["Titulo"];
$noticia=$_POST["Noticia"];
$ruta = "images/{$_FILES['Imagen1'][name]}" ;
$ruta2 = "images/{$_FILES['Imagen2'][name]}" ;
$ruta3 = "images/{$_FILES['Imagen3'][name]}" ;
?>

<?php
$query_ins=mysql_query("INSERT INTO noticias(titulo, noticia, imagen, imagen2, imagen3) VALUES('$titulo', '$noticia', '$ruta', '$ruta2', '$ruta3')", $cn);
copy($_FILES['Imagen1']['tmp_name'], $ruta);
copy($_FILES['Imagen2']['tmp_name'], $ruta2);
copy($_FILES['Imagen3']['tmp_name'], $ruta3);
?>
<?php
mysql_close($cn);
header("Location:mostrar_noticias.php");
?>


editar_noticias.php
----------------------------------
<?php
include("cn.php");
$noticias=mysql_query("select *from noticias order by id desc", $cn);
while($rows=mysql_fetch_array($noticias)){
echo "$rows[1]";
echo "<br />";
echo "$rows[2]";
echo "<img src=panel/$rows[3] />";
echo "<br />";
echo "<img src=panel/$rows[4] />";
echo "<br />";
echo "<p><img src=panel/$rows[5] />";
echo "<br />";
}
?>
<?php
mysql_free_result($noticias);
?>


*La pregunta es, como haria para mostrar todas las imagenes en un tamaño definido x ejemplo 273 x 205