Ich habe ein Problem an dem ich schon eine weile sitze und nicht weiter komme.
Ich habe ein script geschrieben wo man oben ein formular hat und dadrunter wir das Bild das von gdlib generiert wird angezeigt.
Es Funktioniert ja alles wunderbar nur das einzigste problem ist das es bei dem ie nicht funktioniert.
Wenn ich auf den submit button klicke passiert nix aber wenn ich in den ordner schaue wo das bild bespeichert wird sieht man die veränderung, aber es wird nicht angezeigt sondern nur das vorherige bild.
Hier ein Beispiel Probiert es mal mit Mozilla und einmal mit dem Internet Explorer aus da muss man nach dem submit button das ganze Fenstet per F5 oder Aktualiesieren Button refreshen,
Hier gehts zum Beispiel
Ich hoffe jemand kann mir helfen.
Hier der PHP code
Ich habe ein script geschrieben wo man oben ein formular hat und dadrunter wir das Bild das von gdlib generiert wird angezeigt.
Es Funktioniert ja alles wunderbar nur das einzigste problem ist das es bei dem ie nicht funktioniert.
Wenn ich auf den submit button klicke passiert nix aber wenn ich in den ordner schaue wo das bild bespeichert wird sieht man die veränderung, aber es wird nicht angezeigt sondern nur das vorherige bild.
Hier ein Beispiel Probiert es mal mit Mozilla und einmal mit dem Internet Explorer aus da muss man nach dem submit button das ganze Fenstet per F5 oder Aktualiesieren Button refreshen,
Hier gehts zum Beispiel
Ich hoffe jemand kann mir helfen.
Hier der PHP code
PHP-Code:
<html><head></head><title></title><body>
<?
echo "<form name=\"form1\" method=\"post\">";
?>
<table width="668" border="0" align="center">
<tr>
<td width="155">Ihr Text: </td>
<td width="79">Größe</td>
<td width="148">Schriftart</td>
<td width="47">Links</td>
<td width="69">Zentriert</td>
<td width="67">Rechts</td>
<td width="57" rowspan="8" valign="top"></td>
</tr>
<tr>
<td><input name="text1" type="text" value="<?php echo $_POST['text1']; ?>"></td>
<td><select name="select_g1" >
<option <?php if($_POST['select_g1'] == "6pt") echo "selected"; ?> >6pt</option>
<option <?php if($_POST['select_g1'] == "7pt") echo "selected"; ?> >7pt</option>
<option <?php if($_POST['select_g1'] == "8pt") echo "selected"; ?> >8pt</option>
<option <?php if($_POST['select_g1'] == "9pt") echo "selected"; ?> >9pt</option>
<option <?php if($_POST['select_g1'] == "10pt") echo "selected"; ?> >10pt</option>
<option <?php if($_POST['select_g1'] == "11pt") echo "selected"; ?> >11pt</option>
<option <?php if($_POST['select_g1'] == "12pt") echo "selected"; ?> >12pt</option>
<option <?php if($_POST['select_g1'] == "13pt") echo "selected"; ?> >13pt</option>
<option <?php if($_POST['select_g1'] == "14pt") echo "selected"; ?> >14pt</option>
<option <?php if($_POST['select_g1'] == "15pt") echo "selected"; ?> >15pt</option>
<option <?php if($_POST['select_g1'] == "16pt") echo "selected"; ?> >16pt</option>
<option <?php if($_POST['select_g1'] == "17pt") echo "selected"; ?> >17pt</option>
<option <?php if($_POST['select_g1'] == "18pt") echo "selected"; ?> >18pt</option>
<option <?php if($_POST['select_g1'] == "19pt") echo "selected"; ?> >19pt</option>
<option <?php if($_POST['select_g1'] == "20pt") echo "selected"; ?> >20pt</option>
<option <?php if($_POST['select_g1'] == "21pt") echo "selected"; ?> >21pt</option>
<option <?php if($_POST['select_g1'] == "22pt") echo "selected"; ?> >22pt</option>
<option <?php if($_POST['select_g1'] == "23pt") echo "selected"; ?> >23pt</option>
<option <?php if($_POST['select_g1'] == "24pt") echo "selected"; ?> >24pt</option>
<option <?php if($_POST['select_g1'] == "25pt") echo "selected"; ?> >25pt</option>
<option <?php if($_POST['select_g1'] == "26pt") echo "selected"; ?> >26pt</option>
<option <?php if($_POST['select_g1'] == "27pt") echo "selected"; ?> >27pt</option>
<option <?php if($_POST['select_g1'] == "28pt") echo "selected"; ?> >28pt</option>
<option <?php if($_POST['select_g1'] == "29pt") echo "selected"; ?> >29pt</option>
<option <?php if($_POST['select_g1'] == "30pt") echo "selected"; ?> >30pt</option>
</select></td>
<td><select name="select_a1" >
<option <?php if($_POST['select_a1'] == "Fonts/arial.ttf") echo "selected"; ?> value="Fonts/arial.ttf">Arial</option>
<option <?php if($_POST['select_a1'] == "Fonts/arialbd.ttf") echo "selected"; ?> value="Fonts/arialbd.ttf">Arial FETT</option>
<option <?php if($_POST['select_a1'] == "Fonts/ariali.ttf") echo "selected"; ?> value="Fonts/ariali.ttf">Arial Kursiv</option>
<option <?php if($_POST['select_a1'] == "Fonts/times.ttf") echo "selected"; ?> value="Fonts/times.ttf">Times</option>
<option <?php if($_POST['select_a1'] == "Fonts/timesbd.ttf") echo "selected"; ?> value="Fonts/timesbd.ttf">Times FETT</option>
<option <?php if($_POST['select_a1'] == "Fonts/timesi.ttf") echo "selected"; ?> value="Fonts/timesi.ttf">Times Kursiv</option>
<option <?php if($_POST['select_a1'] == "Fonts/symbol.ttf") echo "selected"; ?> value="Fonts/symbol.ttf">mehr folgen s. bild r.</option>
</select></td>
<td><div align="center">
<input type="radio" name="z1" value="links1" <?php if($_POST['z1'] == "links1") echo "checked"; else echo "checked"; ?> >
</div></td>
<td><div align="center">
<input type="radio" name="z1" value="center1" <?php if($_POST['z1'] == "center1") echo "checked"; ?> >
</div></td>
<td><div align="center">
<input type="radio" name="z1" value="rechts1" <?php if($_POST['z1'] == "rechts1") echo "checked"; ?> >
</div></td>
</tr>
<tr>
<td>Rahmen</td>
<td><input type="checkbox" name="rahmen" value="ja" ; <?php if($_POST['rahmen'] == "ja") echo "checked"; ?>></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<input type="submit" name="submit" value="Senden">
</form>
</body></html>
<?
//////////////////////////////////////////////////
$width=250;
$height=100;
$bild = imagecreate($width, $height);
/////////////////////
ImageColorAllocate($bild, 255, 255, 255);
$black = ImageColorAllocate($bild, 0, 0, 0);
if($_POST['rahmen'] == "ja"){
ImageLine($bild, 1, 1, 1, $height, $black);
ImageLine($bild, 1, 1, $width, 1, $black);
ImageLine($bild, 1, $height-1, $width, $height-1, $black);
ImageLine($bild, $width-1, 1, $width-1, $height-1, $black);
}
//////////////
imageantialias($bild, false);
$background_color = imagecolorallocate($bild, 255, 255, 255);
$font_color_1 = imagecolorallocate($bild, 0, 0, 0);
$font_style_1 = $_POST['select_a1'];
$l_s_1=0;
$bild_mitte = round(imagesx($bild)/2);
$bild_ende = round(imagesx($bild));
$abstand=5;
$text1=$_POST[text1]."\n";
$font_size1=$_POST[select_g1];
$a_o_1= $font_size1+$abstand;
if(isset($_POST['z1']) && $_POST['z1'] == links1){ $a_l_1=5; }
if(isset($_POST['z1']) && $_POST['z1'] == center1){ $masse = imagettfbbox ($font_size1, 0, $font_style_1, $text1); imagettftext($bild, $font_size1, $l_s_1, $bild_mitte-($masse[2]/2), $a_o_1, $font_color_1, $font_style_1, $text1); $center_z1=1;}
if(isset($_POST['z1']) && $_POST['z1'] == rechts1){ $masse = imagettfbbox ($font_size1, 0, $font_style_1, $text1); imagettftext($bild, $font_size1, $l_s_1, $bild_ende-($masse[2]+5), $a_o_1, $font_color_1, $font_style_1, $text1); $rechts_z1=1;}
if(isset($_POST['select_a1']) && $center_z1 != 1 && $rechts_z1 != 1 )imagettftext($bild, $font_size1, $l_s_1, $a_l_1, $a_o_1, $font_color_1, $font_style_1, $text1);
imagejpeg($bild, "1.jpg");
imagedestroy($bild);
echo "<center><br><img src='1.jpg'></center>";
?>
Kommentar