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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:34:42+00:00 2026-06-13T10:34:42+00:00

I have a pictures website like Quickmeme.com and I would like to add text

  • 0

I have a pictures website like Quickmeme.com and I would like to add text over images.
I currently let the user upload the picture manually, writing the comments with Paint program in Windows which is a bad idea and I need help …

here is the code I use for Uploading an image, I am thinking of adding a text field below the upload field so what ever the user writes in that box will be printed on the image as an imagetext … So how can I do that with php?

<?php if(isset($_POST["upload"])){

        $tmp_name = $_FILES["file"]["tmp_name"];
        $file_name = basename($_FILES["file"]["name"]);
        $random = rand(1, 9999999999);
        $directory = "Uploads/" . $random . $file_name;
        $time = strftime("%H:%M:%S", time());
        $date = strftime("%Y-%m-%d", time());

            if(move_uploaded_file($tmp_name, $directory)){
                if(mysql_query("")){
                    $query = mysql_query(""); $fetch = mysql_fetch_array($query);
                    if(mysql_query("")){
                        header("Location: index.php");
                        exit;
                    }
                }
            }


      } ?>

Here is my website http://www.picturepunches.net

  • 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-13T10:34:43+00:00Added an answer on June 13, 2026 at 10:34 am

    You can try

    if (isset($_POST["upload"])) {
    
        $tmp_name = $_FILES["file"]["tmp_name"];
        $file_name = basename($_FILES["file"]["name"]);
        $random = rand(1, 9999999999);
        $directory = "Uploads/" . $random . $file_name;
        $time = strftime("%H:%M:%S", time());
        $date = strftime("%Y-%m-%d", time());
    
        switch (strtolower(pathinfo($file_name, PATHINFO_EXTENSION))) {
            case "jpg" :
                $im = imagecreatefromjpeg($_FILES["file"]["tmp_name"]);
                break;
            case "gif" :
                $im = imagecreatefromgif($_FILES["file"]["tmp_name"]);
                break;
            case "png" :
                $im = imagecreatefrompng($_FILES["file"]["tmp_name"]);
                break;
    
            default :
                trigger_error("Error Bad Extention");
                exit();
                break;
        }
    
        $font = 'verdana.ttf';
        $grey = imagecolorallocate($im, 128, 128, 128);
        $red = imagecolorallocate($im, 255, 0, 0);
        // Add some shadow to the text
        imagettftext($im, 10, 0, 11, 20, $grey, $font, $date);
        imagettftext($im, 10, 0, 10, 35, $grey, $font, $time);
        imagettftext($im, 10, 0, 10, 50, $red, $font, $random);
    
        // imagepng($im);
        imagedestroy($im);
    
        if (move_uploaded_file($tmp_name, $directory)) {
            if (mysql_query("")) {
                $query = mysql_query("");
                $fetch = mysql_fetch_array($query);
                if (mysql_query("")) {
                    header("Location: index.php");
                    exit();
                }
            }
        }
    }
    

    Output

    enter image description hereenter image description here

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

Sidebar

Related Questions

I have pictures that I would like to have expand across an entire page
I'm working on a website that hosts music, pictures, and videos. I currently have
I have a GWT-FormPanel on my website, where people can upload pictures and answer
I have a website with all my photos, I would like people to be
I have a website, you can upload pictures via php/mysgl into a database, and
a have a website with more than 400 pictures in a directory. I'd like
When I upload any file everything looks good. I have those pictures in pics
I have a few pictures for a product and I want the user to
Let's say we have: SELECT * FROM Pictures JOIN Categories ON Categories.CategoryId = Pictures.CategoryId
The problem: I have set of pictures, when the user presses on one of

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.