Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8547645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:18:37+00:00 2026-06-11T13:18:37+00:00

I am trying to create an captcha with an really easy calculate sum in

  • 0

I am trying to create an captcha with an really easy calculate sum in it.
But when I try to add + , it turns into a blank box.

Question 2 and 3

Q2 : Is hat header thing really needed and usefull ?

Q3 : $font = dirName(FILE).’/font/karate/Karate.ttf’; Can someone explain me what FILE does?

This is my code :

<?php
    ob_start();
    session_start();

    $randomnr  = rand(1, 5);
    $randomnr2 = rand(1, 5);
    $plus = '+';
    $randanswer = $randomnr + $randomnr2;
    $_SESSION['randomnr2'] = md5($randanswer); 

    $im = imagecreatetruecolor(80, 20);

    $white = imagecolorallocate($im, 255, 255, 255);
    $grey  = imagecolorallocate($im, 150, 150, 150);
    $black = imagecolorallocate($im, 0, 0, 0);

    imagefilledrectangle($im, 0, 0, 80, 25, $black);


    $font = dirName(__FILE__).'/font/karate/Karate.ttf'; //wat is dit?

    imagettftext($im, 15 , 7, 15, 19, $grey, $font, $randomnr);
    imagettftext($im, 15 , 4 , 30, 19, $grey, $font , $plus);  *PROBLEM*
    imagettftext($im, 15 , 10,  50, 19, $white, $font, $randomnr2);

    //prevent caching on client side:
    header("Expires: Wed, 1 Jan 1997 00:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");

    header ("Content-type: image/gif");
    imagegif($im);
    imagedestroy($im);

    ob_end_flush;

?>

example : http://nightcore.nl/captcha/captcha.php

If you see things I absolutely may not do , please tell me and tell me what is better to use!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:18:38+00:00Added an answer on June 11, 2026 at 1:18 pm

    The Karate font you are using, has no PLUS sign as a character!

    see the box with 0043: it is empty.

    __FILE__ is the filename and complete path of the php file now executing.
    dirname(__FILE__) can be replaced with __DIR__ as of php 5.3.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a Captcha in JavaScript but I ran into issues. I
I'm trying to create a captcha code but the code that is being created
I am trying create a table and add this table into tablecell (table inside
Trying to create a black line in my view to separate text blocks but
Trying to create a new Dedicated Cache Role in Windows Azure but get the
I'm trying create a RCP Application with Eclipse, but I can't get past the
I'm trying create a box in my Django app that displays text (and possibly
I'm trying create a new file with a Java Applet, but I don't know
I'm trying to implement a captcha into a form. There are three files: the
I am trying create alert dailog using glade,but its not working .am i doing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.