• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Sicherheitsabfrage

Status
Für weitere Antworten geschlossen.

SaW nO.3

Neues Mitglied
@ sry Frank...


Also ich habe mir heite eine Sicherheitsfrage programmiert.
Als ich die Sicherheitsabfrage testen wollte trat immer der fehler auf der ich ein falschen Sicherheitscode eingegeben habe. Ich weiß aber nicht wo ich den fehler gemacht habe.

Ich habe eine .txt datei namens Sicherheitscode und EINE bilddatei namens seccode.

Ich habe keine unterordner.



PHP:
<tr><td><b><font color=#FFFFFF>Sicherheitscode:</font></b><br><img src="seccode.png" alt="test" ></td><td><input type=edit name=pic><b><font color=#FF0000>


das ist der Ausschnitt wo der Fehler drinne sein müsste.
 
Werbung:
Ich verstehe dich zwar nicht ganz, aber wo prüfst du nach, ob der eingegebene Sicherheitscode richtig ist?
 
Werbung:
Ich habe eine seite gebaut mit einem download center... aber wenn du etwas uploaden willst musst du einen sicherheitscode eingeeb.. diese abfrage ist in einer add.php.

PHP:
<tr><td><font color=#FFFFFF>Titel:</font></td><td><input type=edit name=titel><b> <font color=#FF0000>*</font></b></td></tr>
<tr><td><font color=#FFFFFF>Größe (MB):</font></td><td><input type=edit name=size><b> <font color=#FF0000>*</font></b></td></tr>
<tr><td><font color=#FFFFFF>Passwort:</font></td><td><input type=edit name=passwort></td></tr>
<tr><td><font color=#FFFFFF>Dein Name:</font></td><td><input type=edit name=name></td></tr>
<tr><td><font color=#FFFFFF>Part 1:</font></td><td><input type=edit name=url_1 value=><b> <font color=#FF0000>*</font></b></td></tr>
<?
for($x=2;$x<=10;$x++) {
echo "<tr><td><font color=#FFFFFF>Part $x:</td><td><input type=edit name=url_$x></font></td></tr>";
}
?>
<tr><td><b><font color=#FFFFFF>Sicherheitscode:</font></b><br><img src="seccode.png" alt="test" ></td><td><input type=edit name=pic><b><font color=#FF0000> *</font></b></td></tr>
<tr><td colspan=2 align=center><input type=submit name=Button value=Eintragen> <font color=#FFFFFF><b>(Bitte nur einmal klicken)</font></b></td></tr>
</form></table>
das ist die ganze datei...


PHP:
<?
session_start();
$text = $_SESSION["code"];
$text = "$text";
$rnd = rand(30,200);
$font = "/var/www/frfa.hostia.0lx.net/htdocs/page/comic.ttf";
$i = imagecreate(90,20);
$bg = imagecolorallocate($i,72,72,72);
$col = imagecolorallocate($i,100,151,$rnd);
$x_img = 2;
for ($x=0;$x<=strlen($text);$x++) {
$t = $text[$x];
$rnd = rand(30,200);
$col = imagecolorallocate($i,100,151,$rnd);
$angle = rand(-20,20);
$array = imagettftext ( $i, 15, $angle, $x_img, 17, $col, $font, $t );
$x_img = $array[2] + 5;
}
imagejpeg($i,"",100);
?>



---------- end of image.php---------------


if ($_POST["titel"] && $_POST["url_1"] && $_POST["type"] && $_POST["pic"] == $_SESSION["code"]) {

----------index.php-----------------------

und dass die txt datei
 
Zuletzt bearbeitet von einem Moderator:
Status
Für weitere Antworten geschlossen.
Zurück
Oben