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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:13:17+00:00 2026-05-31T17:13:17+00:00

My problem is when you use for exemple : <img src=/img.jpg /> the src

  • 0

My problem is when you use for exemple :

<img src="/img.jpg" />

the src has to be an image and the image has to be accessible to the person. I want to be able to control the access to those image (if the user is logged for example). IF the person has not access to the image, he can’t access it. My script that controls the access to an image is a php file.

I know .htaccess can limit access to ressources, but I need to valid in the php file. Is there a way to do this or to load the image with javascript (using ajax request) and changing the source of the image to the location of the image in the temp folder?

  • 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-31T17:13:18+00:00Added an answer on May 31, 2026 at 5:13 pm

    Your image source doesn’t necessarily have to point to the real image, neither does it have to be an image:

    <img src="images.php?f=img.jpg" />
    

    Then you can write a PHP script which does the required validations and return the image afterwards through the script

    $image = basename($_GET['f']);
    if (user_has_access()) {
        // You have to determine / send the appropriate MIME-type manually
        header('content-type: image/jpg');
        readfile($image);
    } else {
        header('HTTP/1.1 403 Forbidden');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the problem. I have an image: <img alt=alttext src=filename.jpg/> Note no height or
I've got image tags that look like this: <img src=/path/to/my/image.jpg /> But when I
HTML: <div> <img src=image.png /> </div> JS: $(div img).animate({opacity:.5}, 200); This js works good
<img width='500' height='500' src='image.png'> image.png is larger than 500x500 so when I display it
I'm trying to use TimThumb to display image on my blog <?php the_title(); ?>'><img
I'd like to use an image slider plugin (Elastislide) as a menu. The problem
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
Best to use an example to describe the problem. Lets say I have a
well this is my problem i use 2 source first query (select * from
I'm new in codeigniter I have problem I use my OS X Lion, and

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.