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

Trying to find some simple SQL Server PIVOT examples. Most of the examples that
Trying to honor a feature request from our customers, I'd like that my application,
I'm trying to genererate thumbnails from image files stored in a folder under the
Trying to setup an SSH server on Windows Server 2003. What are some good
Trying to make a make generic select control that I can dynamically add elements
Trying to perform a single boolean NOT operation, it appears that under MS SQL
Trying to pull a value from the sunrise element from [yweather:astronomy] in the Yahoo
Trying to read registry keys remotly (from a host on local intranet)... All the
Trying to find some information on this but am unable to get any results
Trying to execute a Powershell cmdlet from a MVC 3 Controller using impersonation but

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.