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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:41:53+00:00 2026-06-03T15:41:53+00:00

I made this code that is supposed to show me an image with text

  • 0

I made this code that is supposed to show me an image with text on it, but the image just wont appear. Any idea?

<?php

    header("Content-type: image/png"); 
    $md5 = md5(microtime() * mktime()); 

    $string = substr($md5,0,5);

    $captcha = imagecreatefrompng('bg.png'); 

    $black = imagecolorallocate($captcha, 0, 0, 0); 
    $line = imagecolorallocate($captcha,233,239,239); 

    imageline($captcha,0,0,39,29,$line); 
    imageline($captcha,40,0,64,29,$line);

    imagestring($captcha, 5, 20, 10, $string, $black); 

    $_SESSION['key'] = md5($string); 

    imagepng($captcha);
    imagedestroy($captcha);

?>
  • 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-03T15:41:55+00:00Added an answer on June 3, 2026 at 3:41 pm

    You can not use mktime that way you would get the following error Strict standards: mktime() [function.mktime] which would not make your Image display

    Replace

    $md5 = md5(microtime() * mktime());
    

    With

    $md5 = md5(microtime() * time()); 
    

    Your Output

    enter image description here

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

Sidebar

Related Questions

Ok. I've made this awe-crap-code Exporting table to XLS (but still no idea how
I am pretty new at C# and .NET, but I've made this code to
I have a problem, and I made this test code to show you my
Hey. I know this is not a 'refactor my code' site but I made
I've made this html box, that is supposed to have a title and some
I'm working a but of code that is supposed to add a tooltip that
I found this piece of Java code at Wikipedia that is supposed to shuffle
I realize that this is how it's supposed to behave, but it creates a
I am reviewing this technology but have a few design concerns that made me
I have made this code to open a database(created in SQLite browser) stored in

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.