[PHP] Captcha Problem..

Dieses Thema im Forum "Webentwicklung" wurde erstellt von dreamax, 4. Juni 2007 .

Schlagworte:
Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 4. Juni 2007
    Captcha Problem..

    Hallo,
    ich hab letztens nen Script für nen Freund geschrieben. Das auch soweit gut leuft.. Jetzt ist er mit sienem Script auf Euroacc SPace umegzogen und das Script funzt nicht mehr jetzt bin ich mir nicht ganz sicher obs an abgeschaltetem gdlib liegt oder am script. Also er kann das Bild überhaupt nicht darstellen bei firefox kommt halt die message "Dieses Bild kann nicht angezeigt werden da es Fehler enthält"

    Das Script:
    PHP:
    <? PHP 
    header
    ( "Content-type: image/png" );
    session_start ();
    $grafik  ImageCreate  ( 60 25 );
    $hintergrundfarbe  ImageColorAllocate ( $grafik 240 241 233 ); 
    $schriftfarbe     ImageColorAllocate ( $grafik 176 177 178 ); 
    ImageTTFText  ( $grafik 15 3 9 20 $schriftfarbe "font.ttf" $_SESSION [ 'code' ]);
    ImagePNG ( $grafik );
    imagedestroy ( $grafik );
    ?>
    Was phpinfo() über gdlib und apache moduls sagt:
    Code:
    [b]Loaded Modules[/b]:
    mod_security, mod_ssl, mod_php4, mod_perl,
    mod_frontpage, mod_setenvif, mod_so, mod_headers,
    mod_expires, mod_auth_anon, mod_auth, mod_access,
    mod_rewrite, mod_alias, mod_userdir, mod_actions,
    mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex,
    mod_include, mod_info, mod_status, mod_negotiation,
    mod_mime, mod_log_referer, mod_log_agent, mod_log_config,
    mod_env, mod_vhost_alias, http_core
    
    [b]gd[/b]
    GD Support enabled
    GD Version bundled (2.0.28 compatible)
    GIF Read Support enabled
    GIF Create Support enabled
    JPG Support enabled
    PNG Support enabled
    WBMP Support enabled
    XBM Support enabled
    
    PS: Habs auch schon mit GIF antstatt PNG versucht klappt aber auch nichgt...
     
  2. 4. Juni 2007
    AW: Captcha Problem..

    hi, ich post dir einfach mal mein chaptcha script welches ich für solche zwecke geschrieben hab. funktioniert bisher überall (image funktionen vorrausgesetzt)

    PHP:
    <? php
    session_start
    ();
    $text  rand ( 10000 , 100000 );
    $_SESSION [ 'spam_text' ] =  base64_encode ( $text );
    header ( 'Content-type: image/png' );
    $img  ImageCreateFromPNG ( './images/captcha.PNG' );
    $color  ImageColorAllocate ( $img 0 0 0 );
    $ttf  "./arial.ttf" //font muss auf server liegen!
    $ttfsize  11 ;
    $angle  rand ( 0 , 10 );
    $t_x  rand ( 1 , 5 );
    $t_y  20 ;
    imagettftext ( $img $ttfsize $angle $t_x $t_y $color $ttf $text );
    imagepng ( $img );
    imagedestroy ( $img );
    ?>
    musst nur ein backgroundbild und die font hochladen, den pfad dahin ändern und fertig.
     
  3. 4. Juni 2007
    AW: Captcha Problem..

    Kannst ja ma guckn was für n Fehler ausgegeben wird.
    error_reporting(E_ALL);
    und den Header "wegnehmen", oder auf normalen plaintext/oder so setzen und dann die captcha.php aufrufen.
     
  4. 4. Juni 2007
    AW: Captcha Problem..

    Mhh also das script von Murdoc geht auch net liegt am server da anscheinend euroacc php ohne freetype compiliert hat.. :S
     
  5. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.