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

  • Home
  • SEARCH
  • 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 6751513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:56:11+00:00 2026-05-26T12:56:11+00:00

Im trying to rezise some images that are imported from a folder. It doesent

  • 0

Im trying to rezise some images that are imported from a folder. It doesent matter if it only show the realpicture as a thumbnail since the size of the file wont be much larger than 500kb,

Is there a way I can make the images as clickable images ? I have google it , but cant seem to find a solution that helps me.

This is the code that reads from the folder

$files = glob("uploads/*.*"); 

for ($i=1; $i<count($files); $i++) 
{
     $num = $files[$i];
     echo '<img src="'.$num.'" alt="random image">'."&nbsp;&nbsp;";      
}
  • 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-26T12:56:11+00:00Added an answer on May 26, 2026 at 12:56 pm

    I’m not sure how to actually resize the images with PHP to reduce the file size, but to make the browser render them at a small ‘thumbnail’ size just add a CSS class attribute to the images that are pushed out. Something like this:

    echo '<img class="thumb" src="'.$num.'" alt="random image">'."&nbsp;&nbsp;";
    

    Then, just add some CSS for the img.thumb class to the top of your document, or wherever you have the rest of your CSS:

    img.thumb
    {
    width:50px;
    height:50px;
    }
    

    If you want the images to by clickable (presumably linking to the full-size image), just wrap anchor tags around your img tags when echo’ing to the document. Something like this:

    echo '<a href="' . $num . '"><img src="'.$num.'" alt="random image"></a>'."&nbsp;&nbsp;";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to genererate thumbnails from image files stored in a folder under the
I am trying to achieve a check with the if...else statement that only squares
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to install roundcube webmail - had some issues related to driver configuration -
Trying to persist Guid's in a MySQL db from C# (.NET). MySQL column is
Trying to setup a SQL stored procedure that if the variable passed to it
Trying to pull the text value of the label that is dynamically populated by
I'm relatively new to Django, and am trying to make some changes to Django's
Trying to select a random row from a table, based on autoincremented primary key
Trying to learn asio, and I'm following the examples from the website. Why is

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.