You are not logged in.

Dear visitor, welcome to AnnoZone Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Santa

Schatzjäger

  • "Santa" started this thread

Posts: 1,355

Date of registration: Aug 28th 2004

  • Send private message

1

Tuesday, April 10th 2007, 6:22pm

PHP, Grafiken, Sicherheitsabfrage

Moin,
ich möchte in mein Gästebuch eine Sicherheitsabfrage bauen, also wo man so buchstaben abtippen muss.

Problem ist beim Generieren der Grafik.
Ich habe PHP 5.0.4, also eigentlich müsste des doch gehen, ohne dass ich irgendwas einschalte, oder?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
      <?php
      $Grafik = imagecreatefrompng("hintergrund.png");
      $Rahmenmass = imagettfbbox(20, 0, "mistral.ttf", $_GET['Code']);
      $Rahmenmass[5] *= -1;
      $TextBreite = (200-$Rahmenmass[2])/2;
      $TextHoehe = ((50-$Rahmenmass[5])+($Rahmenmass[5]*2))/2;
      
      $Textfarbe = imagecolorallocate($Grafik, 128, 128, 128);
      imagettftext($Grafik, 20, 0, $TextBreite, $TextHoehe, $Textfarbe, "mistral.ttf", $_GET['Code']);
      imagepng($Grafik);
      
      ?>


Diese PHP-Datei soll die Grafik darstellen. hintergrund.png und mistral.ttf liegen natürlich im gleichen Verzeichnis. Die GET-Lösung wird noch durch etwas sicheres ersetzt, muss ich mir noch was überlegen.... Cookies oder MySQL oder so.

Ich verweise so:

Source code

1
2
3
<?php
echo '<img border="0" height="50" src="components/use/securecheckgrafik.php?Code='.$Code.'" width="200" />';
?>

auf die Grafik.

Die Grafik wird aber nicht angezeigt ... jemand ne Idee?
Habe jetzt lange genug das Internet durchwühlt :konfus:

Santa

Schatzjäger

  • "Santa" started this thread

Posts: 1,355

Date of registration: Aug 28th 2004

  • Send private message

2

Tuesday, April 10th 2007, 7:07pm

Dank Andi hab ich nen viel besseres System gefunden. Danke dafür :up:

http://www.stoppt-den-spam.info/webmaste…rial/index.html