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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:34:41+00:00 2026-05-22T23:34:41+00:00

I have a web site which hosts images are shared and linked directly. I’ve

  • 0

I have a web site which hosts images are shared and linked directly. I’ve read somewhere that this is a bad idea. How could I apply simple indirection approach while perhaps keeping existing links up for a while until they disappear off Facebook?

  • 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-22T23:34:42+00:00Added an answer on May 22, 2026 at 11:34 pm

    Old answer below.

    Example for making links that you can’t direct link to:

    $expire = 60 * 5; // 5 minutes;
    $time = $_SERVER['REQUEST_TIME'] + $expire;
    $image_id = $image_id;
    $secretpassword = "secretpassword";
    
    function generate_link($image_id, $time, $secretpassword) {
        $hash = md5($secretpassword . $time . $image_id);
        return "image.php?" . http_build_query(array(
            'image_id' => $image_id,
            'time' => $time,
            'hash' => $hash,
        ));
    }
    
    function is_link_valid($image_id, $time, $hash, $secretpassword) {
        if ($hash !== md5($secretpassword . $time . $image_id)) {
            return false; // hash is invalid
        }
        if ($time < $_SERVER['REQUEST_TIME']) {
            return false; // link has expired
        }
    }
    

    Use like:

    generate_link($image_id, $time, $secretpassword);
    is_link_valid($_GET['image_id'], $_GET['time'], $hash, $secretpassword);
    

    You put two bits of information in the links you generate: the image id and the time when the link should expire (so you can’t direct link). Additionally you add a hash so that no one can ‘mess’ with the variables, only you know how to generate the hash (depends on $secretpassword).

    These links expire after 5 minutes, or whatever you set $expire to.

    One issue is that these links don’t look very pretty. I know ways to make them look prettier but that’s beyond the scope of this question.


    Old answer

    I assume you mean that you share images that are on other domains (like Facebook).

    The problem you describe is that you’re ‘leeching’ off the other domains by using their images (and bandwidth). I don’t know Facebook’s policy about direct links but for lesser sites it’s a real burden. Adding indirection isn’t going to solve this problem.

    The only way to solve it is to upload the images to an image server, either a free one or one that you control yourself. You could have your users do this, or you can do it for them.
    Automating it is hard if you don’t control the image server, but having an image server can be very costly (bandwidth is expensive). Having users do it places the burden on them and might make your site less attractive because they need to perform an extra step.

    I think these are the options you have.

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

Sidebar

Related Questions

I have a web server that hosts Ruby version 1.8.5. Which version of Rails
I have a web site which I download 2-3 MB of raw data from
I have a web page in which people go to register for my site.
I have a web site which will be featured in a place which will
I have an asp.net 4.0 web site that generates email alerts based on several
I have a web site which uses one SQL database but the hosting company
I have an MVC2 web site which I am trying to get working offline
I have another project which contains static content (css, images, JS, etc.), and I
I have a script that fetches several web pages and parses the info. (An
I have a new web app that is packaged as a WAR as part

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.