Jump to content

Search the Community

Showing results for tags 'gd functions'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hey guys, im trying to create a 'captcha' image for registration security for my site. currently i have 2 separate pages working together, my captcha.php file & my register.php now, what i am doing is trying to get a generate code that will be random and create an image with this string. this image will then be linked in the registration form where the user will have to match that random string image. sounds simple except , for some reason the code i have supplied from the tutorial is not outputting the image in the form. i have GD's installed on my server, and i have the font file saved also in the directory/ my code is : captcha.php <?session_start(); header('Content-type: image/jpeg'); $text = $_SESSION['secure']; $font_size = 30; $image_height = 200; $image_width = 40; $image = imagecreate($image_width, $image_height); imagecolorallocate($image, 255, 255, 255); // white $text_color = imagecolorallocate($image, 0, 0, 0); //black imagettftext($image, $font_size, 0, 15, 30, $text_color, 'font.ttf', $text); imagejpeg($image); ?> so in this i have created the image captcha.php should now be a jpeg.. i then go to my register.php declare the $_SESSION and input the src="captcha.php'' register.php <?php include('include/init.php'); $_SESSION['secure'] = rand(1000,9999); ?> and the form : <tr> <td class="register_td_left2"><span class="">Security Code:</span></td> <td valign="middle" style="padding-left:2px"><input id="security_code" name="security_code" type="text" maxlength="4" size="5"></td> <td align="left" valign="middle"><img src="generate.php" alt="Your Security Code"></td> </tr> this is my first time adding a captcha and going through this process. the only thing i can think that would not be allowing it output the image, would be the 'font.tff' not properly working, or for some odd reason i dont have the GD functions installed correctly. any suggestions ? or ideas ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.