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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:54:27+00:00 2026-06-13T19:54:27+00:00

i am displaying an image usign readfile() function of php HMTL: <img src=’image.php?id=232’/> PHP:

  • 0

i am displaying an image usign readfile() function of php

HMTL:

<img src='image.php?id=232'/>

PHP: image.php

<?php
   $id=$_GET["id"];
   if(image_view_allow($id)){
     $path=get_image_path($id);
     readfile($path);
   }else{
     readfile("images/not_allow.png");
   }

image_view_allow and get_image_path is two that i have defined to check validation and get path
I am doing this because i want show image only to the allow person.

Does this affect speed of downloading an image ?
what is normal(means direct path in src attribute of img tag) or trick that is shown above?

  • 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-13T19:54:28+00:00Added an answer on June 13, 2026 at 7:54 pm

    Just loading an image probably same,but it is always better if you handle images with php, because when you resize image with php you load the needed size. But with html you load the bigger size than you need and resize.

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

Sidebar

Related Questions

Displaying an image from a remote server: <img src=http://remotehost/path/to/a.png alt=Image A /> However, if
I'm displaying an image like this: <img src='counter.asp'> counter.asp is doing a hit-counter do
Can anyone advise on what is the best PHP function for displaying an image
Somewhere on my computer I had a PHP script for displaying an image based
I am displaying image by setting the source of an Image element directly to
I'm having trouble with displaying image from db. I think that method for saving
I am displaying an image in tableview cell (Image name saved in a plist).
i am working on displaying an image and placing an icon on top of
I am having trouble displaying an background image in my ASP.NET MVC 2 application.
I am passing image to Raphael. Currently image is displaying square, i want the

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.