Convertir de .php a .png Hola, he creado un formulario con html y php que al llenarlo se crea una imagen, pero lo unico que hace es editar el trainercard.php, haciendo que trainercard.php sea la imagen creada, pero lo que yo quier es que en lugar de editar el trainercard.php se cree un archivo llamado 1.png y cuando alguien mas llene el formulario se haga 2.png como le hago????
El codigo PHP es este: Código PHP: <?php
//Variables para crear la imagen
$nombre=$_POST['nombre'];
$imagen=$_POST['imagen'];
$region=$_POST['region'];
$fc=$_POST['fc1'].-$_POST['fc2'].-$_POST['fc3'];
$medalla1 = imagecreatefromgif($_POST['medalla1']);
$medalla2 = imagecreatefromgif($_POST['medalla2']);
$medalla3 = imagecreatefromgif($_POST['medalla3']);
$medalla4 = imagecreatefromgif($_POST['medalla4']);
$medalla5 = imagecreatefromgif($_POST['medalla5']);
$medalla6 = imagecreatefromgif($_POST['medalla6']);
$medalla7 = imagecreatefromgif($_POST['medalla7']);
$medalla8 = imagecreatefromgif($_POST['medalla8']);
$pokemon1 = imagecreatefrompng($_POST['pokemon1']);
$pokemon2 = imagecreatefrompng($_POST['pokemon2']);
$pokemon3 = imagecreatefrompng($_POST['pokemon3']);
$pokemon4 = imagecreatefrompng($_POST['pokemon4']);
$pokemon5 = imagecreatefrompng($_POST['pokemon5']);
$pokemon6 = imagecreatefrompng($_POST['pokemon6']);
$entrenador = imagecreatefrompng($_POST['entrenador']);
$name= '1.png';
//Fondo y color de texto
$im = imagecreatefrompng($imagen);
$color_texto = imagecolorallocate($im, 255, 255, 255);
//Se genera la imagen
imagestring($im, 5, 140, 10, $nombre, $color_texto);
imagestring($im, 5, 140, 147, $region, $color_texto);
imagestring($im, 2, 125, 30, $fc, $color_texto);
imagecopy($im, $pokemon1, 90, 50, 0, 0, 40, 40);
imagecopy($im, $pokemon2, 132, 50, 0, 0, 40, 40);
imagecopy($im, $pokemon3, 174, 50, 0, 0, 40, 40);
imagecopy($im, $pokemon4, 90, 92, 0, 0, 40, 40);
imagecopy($im, $pokemon5, 132, 92, 0, 0, 40, 40);
imagecopy($im, $pokemon6, 174, 92, 0, 0, 40, 40);
imagecopy($im, $entrenador, 10, 48, 0, 0, 80, 80);
imagecopy($im, $medalla1, 241, 37, 0, 0, 18, 17);
imagecopy($im, $medalla2, 261, 61, 0, 0, 18, 17);
imagecopy($im, $medalla3, 241, 67, 0, 0, 18, 17);
imagecopy($im, $medalla4, 261, 91, 0, 0, 18, 17);
imagecopy($im, $medalla5, 241, 97, 0, 0, 18, 17);
imagecopy($im, $medalla6, 261, 121, 0, 0, 18, 17);
imagecopy($im, $medalla7, 241, 127, 0, 0, 18, 17);
imagecopy($im, $medalla8, 261, 151, 0, 0, 18, 17);
header("Content-type: image/png");
imagepng($im);
?> He hecho muchos intentos y ninguno funcionó, espero me puedan ayudar |