Pues bueno... otra vez con unas cuantas dudas...
1 -> Cree un php para redimensionar imagenes (solo php esta vez) pero o se porque con url remotas no va y con las locales si... he mirado por internet y no encontre nada para poder usarlo con url remotas... a ver si em podeis ayudar...
Código PHP:
<?php
if(isset($_GET['posicion'])==false)
{
$posicion="";
}
else
{
$posicion=$_GET['posicion'];
}
$ruta=basename($_GET['imagen']);
if($posicion=="left" || $posicion=="right")
{
$x_max=200;
}
else
{
$x_max=500;
}
$relxy=0;
$foto=getimagesize($ruta);
if($foto[2]==1)
{
$img = @imagecreatefromgif($ruta);
}
if($foto[2]==2)
{
$img = @imagecreatefromjpeg($ruta);
}
if($foto[2]==3)
{
$img = @imagecreatefrompng($ruta);
}
$img_x=$foto[0];
$img_y=$foto[1];
$relxy=$x_max/$img_x;
if($relxy<1)
{
$img_x=$x_max;
$img_y=$img_y*$relxy;
}
$thumb = imagecreatetruecolor($img_x,$img_y);
imagecopyresampled($thumb, $img, 0, 0, 0, 0, $img_x,$img_y, $foto[0], $foto[1]);
if($foto[2]==1)
{
header("Content-type: image/gif");
imagegif($thumb);
}
if($foto[2]==2)
{
header("Content-type: image/jpeg");
imagejpeg($thumb);
}
if($foto[2]==3)
{
header("Content-type: image/png");
imagepng($thumb);
}
imagedestroy($thumb);
?>
2 - Cree otro php que se llama a si mismo para actualizar datos en una base de datos... el problema es que no hace nada... ya parece ridiculo, pero no ahce nada... me parece que el problema esta en los isset...
Código PHP:
<?php
if(isset($_GET['id'])==False)
{
$ind=$_GET['index'];
}
else
{
$ind=$_GET['id'];
}
include("./Conexio_BD_tutoria.php");
include("./adodb/adodb.inc.php");
$sql="SELECT * FROM xbox where id='".$ind."'";
$resultat=$conexio->Execute($sql) or DIE ($conexio->ErrorMsg());
if(isset($_GET['Enviar'])==True)
{
$reg=array();
$reg['titulo']=$_GET['titulo'];
$reg['mensaje']=$_GET['mensaje'];
$reg['data']=date("Y-m-d");
$SQL_update= $conexio->GetUpdateSQL($resultat,$reg);
$conexio->Execute($SQL_update);
$resultat->Close();
$conexio->Close();
header("Location: index.php");
}
else
{
echo $editar="
<html>
<head>
<title>Editar</title>
<link href='style.css' rel='stylesheet' type='text/css' media='screen' />
</head>
<body>
<form name='envio' method='GET' action='".$_SERVER['PHP_SELF']."'>
<center><table>
<tr><td><p>Index en la tabla: </td></tr>
<tr><td><input type='text' name='index' size='50' value=".$resultat->fields['id']."></td></tr>
<tr><td><p>Editar Titulo: </td></tr>
<tr><td><input type='text' name='titulo' size='50' value=".$resultat->fields['titulo']. "></td></tr>
<tr><td><p>Contenido de la publicacion: </p></td></tr>
<tr><td><textarea rows='10' cols='100' wrap='soft' name='mensaje' value=".$resultat->fields['mensaje']."</textarea></td></tr>
<tr><td><p>Contraseña: </td></tr>
<tr><td><input type='password' name='codi' size='20'>
</td></tr></table>
<input type='submit' value='Enviar'></center>
</form>
<a href='index.php'>Volver al index</a>
</body>
</html>";
}
?>