Foros del Web » Programando para Internet » PHP »

Redimension

Estas en el tema de Redimension en el foro de PHP en Foros del Web. hola! tengo una pequeña duda. tengo este script Código PHP: $newName  = "../../../img/album/" . $id . "/thumb/" . $num . ".jpg" ; $name  =  "img/album/" ...
  #1 (permalink)  
Antiguo 06/07/2007, 21:19
 
Fecha de Ingreso: marzo-2006
Mensajes: 401
Antigüedad: 18 años, 1 mes
Puntos: 1
Redimension

hola!


tengo una pequeña duda. tengo este script


Código PHP:
$newName ="../../../img/album/".$id."/thumb/".$num.".jpg";
$name "img/album/".$id."/thumb/".$num.".jpg";

// Content-type para el navegador


// Se obtienen las nuevas dimensiones
list($width$height) = getimagesize($filename);
$newwidth 90;
$newheight 90;

// Cargar la imagen
$thumb imagecreatetruecolor($newwidth$newheight);
$source imagecreatefromjpeg($filename);

// Redimensionar
 
imagecopyresampled($thumb$source0000$newwidth$newheight$width$height);

// Mostrar la nueva imagen
imagejpeg($thumb,"$newName",100); 
como ven en NewName esta esto
Código PHP:
$newName ="../../../img/album/".$id."/thumb/".$num.".jpg"
../../../ <---esto en la internet no funciona del todo bien , puse esto http://laruta.com . pero no funciono . quien me puede decir una forma mas hacer de evitar los ../../..
__________________
Importzona.com - Portal Racing
Tunerspot.net - your spot on net
  #2 (permalink)  
Antiguo 07/07/2007, 04:46
Avatar de jerkan  
Fecha de Ingreso: septiembre-2005
Mensajes: 1.607
Antigüedad: 18 años, 7 meses
Puntos: 19
Re: Redimension

Los ../ son para subir un nivel en el árbol de directorios.

Para evitar tener que utilizar direcciones relativas (este caso) se aconseja utilizar un dispatcher. Con esta técnica, todas las urls de la aplicación tendrán como raíz la localización del dispatcher. Te invito a que te documentes sobre el tema. Requiere un poco más de trabajo pero vale la pena.

un saludo
  #3 (permalink)  
Antiguo 11/07/2007, 22:46
 
Fecha de Ingreso: marzo-2006
Mensajes: 401
Antigüedad: 18 años, 1 mes
Puntos: 1
Re: Redimension

para crear una carpeta puedo poner la ruta asi "/public_html/img/album/nueva_carpeta"
__________________
Importzona.com - Portal Racing
Tunerspot.net - your spot on net
  #4 (permalink)  
Antiguo 12/07/2007, 19:21
 
Fecha de Ingreso: marzo-2006
Mensajes: 401
Antigüedad: 18 años, 1 mes
Puntos: 1
Re: Redimension

nadie?
...
__________________
Importzona.com - Portal Racing
Tunerspot.net - your spot on net
  #5 (permalink)  
Antiguo 13/07/2007, 12:47
 
Fecha de Ingreso: marzo-2006
Mensajes: 401
Antigüedad: 18 años, 1 mes
Puntos: 1
Re: Redimension

...........................????
__________________
Importzona.com - Portal Racing
Tunerspot.net - your spot on net
  #6 (permalink)  
Antiguo 13/07/2007, 12:50
okram
Invitado
 
Mensajes: n/a
Puntos:
Re: Redimension

Claro

Un saludo,
  #7 (permalink)  
Antiguo 14/07/2007, 11:17
 
Fecha de Ingreso: marzo-2006
Mensajes: 401
Antigüedad: 18 años, 1 mes
Puntos: 1
Re: Redimension

Cita:
Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(/public_html/beta/b/img/album/45) is not within the allowed path(s): (/home:/tmp:/usr) in /home/importz/public_html/crear.php on line 6
mkdir("/public_html/beta/b/img/album/45");
__________________
Importzona.com - Portal Racing
Tunerspot.net - your spot on net
  #8 (permalink)  
Antiguo 14/07/2007, 17:15
okram
Invitado
 
Mensajes: n/a
Puntos:
Re: Redimension

y si borras el /public_html?

Un saludo,
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:09.