Bonsoir,

Je dispose de 2 fichiers :
index.php, et logo.php

index.php contient mon formulaire :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
<html>
<style type="text/css">
body {
background-color: black;
</style>
<form method="post" action="logo.php">
<center><p style="color:white;">
<input type=text name="texte1" size="45" rows="1" maxlength="35"><br>
<input type=text name="texte2" size="45" rows="1" maxlength="40">
<input type="submit" name="send" value="Envoyer"><br></p>
</form></center></html>
et logo.php contient l'image :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
<?php
$nom_image = "test.png";
$image = imagecreatefrompng($nom_image);
$text01 = trim(stripslashes(strip_tags($_POST['texte1'])));
$text02 = trim(stripslashes(strip_tags($_POST['texte2'])));
$blanc = imagecolorallocate($image, 249, 249, 255);
$noir = imagecolorallocate($image, 0, 0, 0);
header ("Content-type: image/png");
$tb = imagettfbbox(11, 0, 'Calibri.ttf', $text01);
$tc = imagettfbbox(8, 0, 'Calibri.ttf', $text02);
$x = imagesx($image);
$y = ceil(($x - $tb[2]) / 2);
$z = ceil(($x - $tc[2]) / 2);
imagettftext($image, 11, 0, $y, 17, $noir, 'Calibri.ttf', $text01);// ombre
imagettftext($image, 11, 0, $y, 16, $blanc, 'Calibri.ttf', $text01);
imagettftext($image, 8, 0, $z, 34, $noir, 'Calibri.ttf', $text02);
imagepng($image);
imagedestroy($image);
?>
Cela fonctionne bien mais le 'form action' vers logo.php nous affiche juste l'image modifiée, dans une page blanche. J'aimerai en fait que l'image modifiée apparaisse dynamiquement sous le formulaire, après validation de ce dernier. Quelles peuvent-être les solutions à ce petit problème ?
Merci