ERLEDIGT
NEIN
NEIN
ANTWORTEN
19
19
ZUGRIFFE
848
848
EMPFEHLEN
-
02.06.10 16:27 #1
- Registriert seit
- Jan 2010
- Beiträge
- 16
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!
-
Hi
wenn das Captcha richtig eingegeben wurde, startest du den Download, wenn nicht lädst du die Seite und damit das Captcha neu. Wo liegt jetzt dein Problem? Weißt du nicht wie man ein Captcha erstellt oder einen Dateidownload? Dazu solltest du bei Google ziemlich viele Einträge finden.Bei Problemen mit Codes, postet bitte den entsprechenden Codeausschnitt und setzt den in entsprechende Tags.
( [cpp] [/cpp] [css] [/css] [html] [/html] [java] [/java] [javascript] [/javascript] [php] [/php] [sql] [/sql] )
"Funktioniert nicht" ist keine Fehlermeldung. Bitte eine genaue Fehlerbeschreibung und, wenn vorhanden, Fehlermeldungen posten.
RegEx Tutorial
PHP Funktionsreferenz
-
02.06.10 16:31 #3
Google doch einfach nach PHP und Captcha: http://www.google.de/#hl=de&source=h...f8c3e74190a678
mfg ComFreek
Falls ich dir geholfen habe, würde ich mich über ein DANKE freuen!
Kenn mich am besten aus in C++, WEB-Sprachen (PHP, HTML, JavaScript) und vllt. mehr
[PHP] Überprüfen, ob Website erreichbar • Sicherheit in PHP-Codes schaffen • Google Chrome-Extension für tutorials.de • json_compress()
-
Und wenn du nett bist nutzt du ein reCaptcha und hilfst gedruckte / geschriebene / etc. Texte zu digitalisieren
http://recaptcha.net/Gebe keine Hilfe per PN, Mail, Instant Messenger etc.
und keine Copy&Paste-Lösungen - ein bisschen selbst nachdenken sollte drin sein. Konstruktivismus 4tw!
MfG, Zod
__________________
rpd Framework: Rapid Web-Engineering in PHP (Manual | Google Code)
-
02.06.10 16:47 #5
- Registriert seit
- Jan 2010
- Beiträge
- 16
Ja hab ich, aber habe nirgendwo etwas gefunden, wie man das macht mit zum Datei Download. Da ist ja nur ein Submit Form.
Ich habe da auch etwas probiert, aber hat irgendwie nicht geklappt:
Das hier habe ich als spam.html gespeichert:
Dann habe ich das hier antispam.php gespeichert:HTML-Code:<!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>
PHP-Code:<?php
$url = jesmedia.comoj.com/download?f=Footer_1.png';
?>
und im antispam habe ich das gespeicheert:
PHP-Code:<?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($charset, mt_rand(0, strlen($charset) - 1), 1);
}
$font_size = $height * 0.7;
$image = @imagecreate($width, $height);
$background_color = @imagecolorallocate($image, 255, 20, 100);
$noise_color = @imagecolorallocate($image, 90, 50, 100);
/* add image noise */
for($i=0; $i < ($width * $height) / 4; $i++) {
@imageellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color);
}
/* render text */
$text_color = @imagecolorallocate($image, 0, 0, 0);
@imagettftext($image, $font_size, 0, 7,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
-
02.06.10 16:52 #6
(Du hast doppelt gepostet! Das gleiche!)Maik hats behoben.
Das mit dem Download ist leicht. Als Ziel musst du nur ein PHP-Skript angeben, welches überprüft, ob der eingegebene Code richtig ist und ggf. die Datei zum Download bereitstellt:
PHP-Code:if (IsRightCode())
{
header("Content-disposition: attachment; filename=fname.exe");
}
Geändert von ComFreek (02.06.10 um 20:01 Uhr)
mfg ComFreek
Falls ich dir geholfen habe, würde ich mich über ein DANKE freuen!
Kenn mich am besten aus in C++, WEB-Sprachen (PHP, HTML, JavaScript) und vllt. mehr
[PHP] Überprüfen, ob Website erreichbar • Sicherheit in PHP-Codes schaffen • Google Chrome-Extension für tutorials.de • json_compress()
-
Das halte ich jetzt mal für schier gelogen.
Google: Suchbegriff: Php download scriptBei Problemen mit Codes, postet bitte den entsprechenden Codeausschnitt und setzt den in entsprechende Tags.
( [cpp] [/cpp] [css] [/css] [html] [/html] [java] [/java] [javascript] [/javascript] [php] [/php] [sql] [/sql] )
"Funktioniert nicht" ist keine Fehlermeldung. Bitte eine genaue Fehlerbeschreibung und, wenn vorhanden, Fehlermeldungen posten.
RegEx Tutorial
PHP Funktionsreferenz
-
02.06.10 19:59 #8Maik Tutorials.de Gastzugang
-
02.06.10 20:26 #9
- Registriert seit
- Jan 2010
- Beiträge
- 16
-
02.06.10 20:31 #10
Also du hast ein Formular z.B. in index.php, das auf "download.php" zeigt bzw. dahin abgeschickt wird.
Und in der "download.php" prüfst du, ob der Code richtig ist (hier IsRightCode()), wenn er richtig ist, dann soll die Datei zum Download erscheinen.HTML-Code:<form action="download.php" method="post"> <input ...
Jetzt ist die Frage, wie du die Datei speicherst bzw. identifizierst.mfg ComFreek
Falls ich dir geholfen habe, würde ich mich über ein DANKE freuen!
Kenn mich am besten aus in C++, WEB-Sprachen (PHP, HTML, JavaScript) und vllt. mehr
[PHP] Überprüfen, ob Website erreichbar • Sicherheit in PHP-Codes schaffen • Google Chrome-Extension für tutorials.de • json_compress()
-
02.06.10 20:42 #11
- Registriert seit
- Jan 2010
- Beiträge
- 16
Das hier wird mein download.php, wo wird jetzt das script von dir eingebaut?
PHP-Code:<?php
// Allow direct file download (hotlinking)?
// Empty - allow hotlinking
// If set to nonempty value (Example: example.com) will only allow downloads when referrer contains this text
define('ALLOWED_REFERRER', '');
// Download folder, i.e. folder where you keep all files for download.
// MUST end with slash (i.e. "/" )
define('BASE_DIR','img/');
// log downloads? true/false
define('LOG_DOWNLOADS',true);
// log file name
define('LOG_FILE','downloads.log');
// Allowed extensions list in format 'extension' => 'mime type'
// If myme type is set to empty string then script will try to detect mime type
// itself, which would only work if you have Mimetype or Fileinfo extensions
// installed on server.
$allowed_ext = array (
// archives
'zip' => 'application/zip',
// documents
'pdf' => 'application/pdf',
'doc' => 'application/msword',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint',
// executables
'exe' => 'application/octet-stream',
// images
'gif' => 'image/gif',
'png' => 'image/png',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
// audio
'mp3' => 'audio/mpeg',
'wav' => 'audio/x-wav',
// video
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'mov' => 'video/quicktime',
'avi' => 'video/x-msvideo'
);
####################################################################
### DO NOT CHANGE BELOW
####################################################################
// If hotlinking not allowed then make hackers think there are some server problems
if (ALLOWED_REFERRER !== ''
&& (!isset($_SERVER['HTTP_REFERER']) || strpos(strtoupper($_SERVER['HTTP_REFERER']),strtoupper(ALLOWED_REFERRER)) === false)
) {
die("Internal server error. Please contact system administrator.");
}
// Make sure program execution doesn't time out
// Set maximum script execution time in seconds (0 means no limit)
set_time_limit(0);
if (!isset($_GET['f']) || empty($_GET['f'])) {
die("Please go to the Mainpage.");
}
// Get real file name.
// Remove any path info to avoid hacking by adding relative path, etc.
$fname = basename($_GET['f']);
// Check if the file exists
// Check in subfolders too
function find_file ($dirname, $fname, &$file_path) {
$dir = opendir($dirname);
while ($file = readdir($dir)) {
if (empty($file_path) && $file != '.' && $file != '..') {
if (is_dir($dirname.'/'.$file)) {
find_file($dirname.'/'.$file, $fname, $file_path);
}
else {
if (file_exists($dirname.'/'.$fname)) {
$file_path = $dirname.'/'.$fname;
return;
}
}
}
}
} // find_file
// get full file path (including subfolders)
$file_path = '';
find_file(BASE_DIR, $fname, $file_path);
if (!is_file($file_path)) {
die("File does not exist. Make sure you specified correct file name.");
}
// file size in bytes
$fsize = filesize($file_path);
// file extension
$fext = strtolower(substr(strrchr($fname,"."),1));
// check if allowed extension
if (!array_key_exists($fext, $allowed_ext)) {
die("Not allowed file type.");
}
// get mime type
if ($allowed_ext[$fext] == '') {
$mtype = '';
// mime type is not set, get from server settings
if (function_exists('mime_content_type')) {
$mtype = mime_content_type($file_path);
}
else if (function_exists('finfo_file')) {
$finfo = finfo_open(FILEINFO_MIME); // return mime type
$mtype = finfo_file($finfo, $file_path);
finfo_close($finfo);
}
if ($mtype == '') {
$mtype = "application/force-download";
}
}
else {
// get mime type defined by admin
$mtype = $allowed_ext[$fext];
}
// Browser will try to save file with this filename, regardless original filename.
// You can override it if needed.
if (!isset($_GET['fc']) || empty($_GET['fc'])) {
$asfname = $fname;
}
else {
// remove some bad chars
$asfname = str_replace(array('"',"'",'\\','/'), '', $_GET['fc']);
if ($asfname === '') $asfname = 'NoName';
}
// set headers
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: $mtype");
header("Content-Disposition: attachment; filename=\"$asfname\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $fsize);
// download
// @readfile($file_path);
$file = @fopen($file_path,"rb");
if ($file) {
while(!feof($file)) {
print(fread($file, 1024*8));
flush();
if (connection_status()!=0) {
@fclose($file);
die();
}
}
@fclose($file);
}
// log downloads
if (!LOG_DOWNLOADS) die();
$f = @fopen(LOG_FILE, 'a+');
if ($f) {
@fputs($f, date("m.d.Y g:ia")." ".$_SERVER['REMOTE_ADDR']." ".$fname."\n");
@fclose($f);
}
?>
-
02.06.10 20:44 #12
Eigentlich ganz am Anfang.
mfg ComFreek
Falls ich dir geholfen habe, würde ich mich über ein DANKE freuen!
Kenn mich am besten aus in C++, WEB-Sprachen (PHP, HTML, JavaScript) und vllt. mehr
[PHP] Überprüfen, ob Website erreichbar • Sicherheit in PHP-Codes schaffen • Google Chrome-Extension für tutorials.de • json_compress()
-
02.06.10 20:49 #13
- Registriert seit
- Jan 2010
- Beiträge
- 16
-
02.06.10 20:52 #14
filename ist der Name, der dem Benutzer angezeigt wird.
Die zu runterladene Datei musst du mit echo ausgebenmfg ComFreek
Falls ich dir geholfen habe, würde ich mich über ein DANKE freuen!
Kenn mich am besten aus in C++, WEB-Sprachen (PHP, HTML, JavaScript) und vllt. mehr
[PHP] Überprüfen, ob Website erreichbar • Sicherheit in PHP-Codes schaffen • Google Chrome-Extension für tutorials.de • json_compress()
-
02.06.10 20:58 #15
- Registriert seit
- Jan 2010
- Beiträge
- 16
Wäre das richtig?PHP-Code:[QUOTE=ComFreek;1871198]filename ist der Name, der dem Benutzer angezeigt wird.
Die zu runterladene Datei musst du mit echo ausgeben[/QUOTE]
if (IsRightCode())
{
header("Content-disposition: attachment; filename=fname.exe");
echo "<a href="download.php?f=datei.png">Download</a>";
}
Ähnliche Themen
-
Wie macht man solchen äh 3D-Säulen Effekt?
Von MCrookieDe im Forum PhotoshopAntworten: 7Letzter Beitrag: 26.06.07, 13:07 -
Wie erstelle ich einen solchen Effekt?
Von myBlack im Forum PhotoshopAntworten: 3Letzter Beitrag: 11.02.07, 18:20 -
Wie erstelle ich einen solchen Bildeffekt?
Von julchen im Forum PhotoshopAntworten: 2Letzter Beitrag: 01.07.06, 04:38 -
Objektorganisation eines solchen Models
Von Razorhawk im Forum 3D Studio MaxAntworten: 6Letzter Beitrag: 13.09.04, 13:24 -
Wie einen solchen Effekt hinkriegen?
Von julchen im Forum PhotoshopAntworten: 3Letzter Beitrag: 23.07.04, 16:24





Zitieren



Login






[PHP][Snippet] Array zu XML konvertieren