
Codigo Ayuda !!!
Publicado por Alex (1 intervención) el 17/03/2022 21:13:53
estoy tratando de crear certificados con fotografia de forma automatica, logo poner el texto como imagen pero no logo que la foto aparezca , no tengo mucha experiencia en programación, si alguien me puede asesorar !!!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IDCARD 2022 HERE WE GO IN MEXICO</title>
<style type="text/css">
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
}
</style>
</head>
<body>
<form action="procesar.php">
<p>Nombre Apellido
:
<input type="text" name="texto1" required placeholder="Primera línea"><br>
</p>
<p>Foto :
<input type="file" name="image" required placeholder="Segunda línea">
<br>
</p>
<button type="submit">Enviar</button>
</form>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
if (!isset($_GET["texto1"]) || !isset($_GET["texto1"])) {
exit("No hay texto que colocar");
}
$rutaFuente = __DIR__ . "/" . "edosz.ttf";
$nombreImagen = "imagen.png";
$imagen = imagecreatefrompng($nombreImagen);
$color = imagecolorallocate($imagen, 0, 0, 0);
$texto1 = $_GET["texto1"];
$image = $_GET["image"];
$tamanio = 60;
$tamanio2 =20;
$angulo = 0;
$espacio = 10;
$x = 230;
$y = 1750;
$x2 = 640;
$y2 = 170;
imagettftext($imagen, $tamanio, $angulo, $x, $y, $color, $rutaFuente, $texto1);
header("Content-Type: image/png");
imagepng($imagen);
imagedestroy($imagen);
Valora esta pregunta


0