Wie macht man ein captcha um datein runter zu laden?


 
Neues Thema eröffnen   Neue Antwort erstellen    Webmaster Forum -> Hilfe für Webmaster -> PHP / MySQL
Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
Kajen_Jeyam
Gast

BeitragWie macht man ein captcha um datein runter zu laden? Antworten mit Zitat

axinio Internet Marketing
Hallo!

Ich würde gerne wissen, wie man Captcha benutzen kann um eine Datei zu downloaden. Also man muss das richtige Captcha eingeben, damit man die Datei downloaden kann. Es soll genauso funktionieren, wie auf der Megaupload Seite.

Hier ein Beispiel:

http://www.megaupload.com/?d=TZN3KGZI

Erst wenn man den Code richtig eingibt, kann man die Datei Downloaden. Gibt man den falschen code ein, ladet es ein neuen captcha. Wie funktioniert das? Und kann man das vlt auch nachbauen? Wäre dankbar für jede Hilfe danke!
02 Jun 2010 15:29
Gast


BeitragRe: Wie macht man ein captcha um datein runter zu laden? Antworten mit Zitat

Ich habe da auch etwas probiert, aber hat irgendwie nicht geklappt:

Das hier habe ich als spam.html gespeichert:

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
</head>

<body>

<div>
<?php

@session_start(); // start session if not started yet
if ($_SESSION['AntiSpamImage'] != $_REQUEST['anti_spam_code']) {
// set antispam string to something random, in order to avoid reusing it once again
$_SESSION['AntiSpamImage'] = rand(1,9999999);

// here you add code to let user know incorrect code entered

echo "Wrong Code! Try Again";
}
else {
// set antispam string to something random, in order to avoid reusing it once again
$_SESSION['AntiSpamImage'] = rand(1,9999999);

// everything is fine, proceed with processing feedback/comment/etc.

}

?>
<img src="antispam.php">
<input name="anti_spam_code">
<a href="get.php">Downloaden Sie hier! </a></div>
</body>
</html>[/HTML]

Dann habe ich das hier antispam.php gespeichert:

PHP-Code:
1
2
3
4
<?php

$url 
jesmedia.comoj.com/download?f=Footer_1.png';
?>



und im antispam habe ich das gespeicheert:

PHP-Code:
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
###############################################################
# Anti-spam Image Generator (CAPTCHA) 1.0
###############################################################
# For updates visit http://www.zubrag.com/scripts/
############################################################### 

// Font name to use. Make sure it is available on the server.
// You could upload it to the same folder with script if it cannot find font.
// By default it uses arial.ttf font.
$font 'arial';

// list possible characters to include on the CAPTCHA
$charset '0123456789';

// how many characters include in the CAPTCHA
$code_length 6;

// antispam image height
$height 20;

// antispam image width
$width 80;

############################################################
#  END OF SETTINGS
############################################################

// this will start session if not started yet
@session_start();

$code '';
for(
$i=0$i $code_length$i++) {
  
$code $code substr($charsetmt_rand(0strlen($charset) - 1), 1);
}

$font_size $height 0.7;
$image = @imagecreate($width$height);
$background_color = @imagecolorallocate($image25520100);
$noise_color = @imagecolorallocate($image9050100);

/* add image noise */
for($i=0$i < ($width $height) / 4$i++) {
  @
imageellipse($imagemt_rand(0,$width), mt_rand(0,$height), 11$noise_color);
}
/* render text */
$text_color = @imagecolorallocate($image000);
@
imagettftext($image$font_size07,17,
              
$text_color$font $code)
  or die(
'Cannot render TTF text.');

/* output image to the browser */
header('Content-Type: image/png');
@
imagepng($image) or die('imagepng error!');
@
imagedestroy($image);
$_SESSION['AntiSpamImage'] = $code;
exit();
?>



Funkt aber nicht :S
PHP-Code:
1
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center" style="table-layout: fixed;"><tr>       <td><span class="genmed"><b>Code:</b></span></td>    </tr>    <tr>      <td class="code"><div style="overflow: auto; width: 100%;">      </div></td>    </tr></table><span class="postbody"
02 Jun 2010 15:51
Werner
Homepage-Total.de
Moderator

Beitrag Antworten mit Zitat

Ich habe das Script nicht getestet, aber:
Code:
@session_start();

gehört an den Seitenanfang (ohne das vorher etwas an den Browser gesendet wurde (auch kein Leerzeichen!))
Code:

<?php @session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
</head>

<body>

<div>

_________________
Bei Fragen oder Fehlermeldungen - Bitte ausführlichen Code posten!
Wie man Fragen richtig stellt
02 Jun 2010 20:51
Benutzer-Profile anzeigen Private Nachricht senden Website dieses Benutzers besuchen
axinio Internet Marketing
Beiträge der letzten Zeit anzeigen:   
Neues Thema eröffnen   Neue Antwort erstellen    Webmaster Forum -> Hilfe für Webmaster -> PHP / MySQL Alle Zeiten sind GMT + 1 Stunde
Seite 1 von 1

 
Gehe zu:  

Ähnliche Beiträge
Thema Webmaster Forum Antw. Autor Verfasst am
Keine neuen Beiträge Vertikal zentriertes Div macht Proble... CSS 0 sora 20 Sep 2011 13:16 Letzten Beitrag anzeigen
Keine neuen Beiträge beim Laden der page ein Dreifach-Cook... Javascript 0 Feldadmin61 03 März 2011 10:59 Letzten Beitrag anzeigen
Keine neuen Beiträge Laden aus dem Cache Computer & Internet 4 LkBibo 15 Sep 2010 08:56 Letzten Beitrag anzeigen
Keine neuen Beiträge preload + GIF als Wartezeichen für Bi... Grafik- & Webdesign 1 derzeit noch Gast 12 Aug 2010 18:12 Letzten Beitrag anzeigen
Keine neuen Beiträge 2 xml datein auslesen und in neue xml... PHP / MySQL 1 Gast 27 Apr 2010 03:38 Letzten Beitrag anzeigen