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 6786531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:15:24+00:00 2026-05-26T17:15:24+00:00

Regarding captcha In local PC is working fine but when upload to server (CentOS5.5)

  • 0

Regarding captcha In local PC is working fine but when upload to server (CentOS5.5)

PHP captcha cannot load.

This is php code call get_captcha.php:

$('#captcha-refresh').click(function() {  
  change_captcha();
});

function change_captcha()
{           
  document.getElementById('captcha').src="get_captcha.php?rnd=" + Math.random();
}

get_captcha.php:

for ($i = 0; $i < 4; $i++) 
{
    $word_1 .= chr(rand(97, 122));
}
for ($i = 0; $i < 4; $i++) 
{
    $word_2 .= chr(rand(97, 122));
}

$_SESSION['random_number'] = $word_1.' '.$word_2;
$dir = 'fonts/';
$image = imagecreatetruecolor(165, 50);
$font = "recaptchaFont.ttf"; // font style
$color = imagecolorallocate($image, 0, 0, 0);// color
$white = imagecolorallocate($image, 255, 255, 255); // background color white
imagefilledrectangle($image, 0,0, 709, 99, $white);
imagettftext ($image, 22, 0, 5, 30, $color, $dir.$font, $_SESSION['random_number']);
header("Content-type: image/png");
imagepng($image);  
$_SESSION['random_numberafter'] = $_SESSION['random_number'];
  • 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-05-26T17:15:24+00:00Added an answer on May 26, 2026 at 5:15 pm

    Check if the GD library is installed in your server or not. You can check it by using phpinfo();

    Try running the file get_captcha.php with a random number and see the images is displayed or not. Thanks

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

Sidebar

Related Questions

Regarding the below code, how does the compiler choose which template function to call?
Regarding Uploadify Hello, Currently I have a PHP only upload script and I'm planning
Regarding the below code snippet i understand the bit but i have few confusion
Regarding this specification: http://www.w3.org/TR/eventsource/ How does one close the opened connection on the server?
Regarding TJvRichEdit and Delphi... How? Load/Save rtf (including text and images - not only
Regarding class public class declaration, please look at these two pieces of code: public
Regarding this post and this other one . Suppose I have the following: public
Regarding the terminate handler, As i understand it, when something bad happens in code,
CAPTCHAs that ask users to read distorted text are fine for sighted people, but
Regarding this SO article and this SO article. I looked at these after noticing

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.