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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:29:10+00:00 2026-05-16T10:29:10+00:00

I was wondering if someone can provide me with a tutorial or source code

  • 0

I was wondering if someone can provide me with a tutorial or source code of a way to make it so if people are leeching my sites images and embedding them in their forums or sites it will show a watermark, but if they view it on my site their wont be a watermark?

  • 1 1 Answer
  • 2 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-16T10:29:10+00:00Added an answer on May 16, 2026 at 10:29 am

    First, a small detour into HTTP

    HTTP is, essentially, the core protocol of the Web – used to transfer hypertext (web pages), images and other media. From the beginning, HTTP was designed to be stateless – amongst other things, this means that it’s not possible to find if a request for an image "belongs to" a page or another.

    There are basically two workarounds for this in HTTP, but neither is 100% reliable: cookies and the Referer header.

    With cookies, you could set a cookie when a user accesses your page, and then check that when serving the images. This may run into concurrency problems when entering the page for the first time.

    With Referer, the browser sends in he request for the image an URL from which the image is loaded. Unfortunately, the referer can be easily modified or removed by the user or by security software.

    What that means for you

    I suggest that you use the Referer field – although it’s not 100% reliable, most people won’t bother messing with it, and those who will bother, well, they would overcome any other protection.

    You’ll need to serve your images through a script (e.g. PHP).

    http://example.com/img.php?id=12345 – pseudocode for the check, PHP for the watermark itself:

    check if the image with given ID exists, else throw a 404 and end
    check the referer - if it matches your site, just readfile() the relevant image and exit
    if we're here, referer is wrong - you'll need the watermark:
    // PHP code from now on
    $original = imagecreatefromjpeg($original_image_path);
    $watermark =  imagecreatefromjpeg($watermark_image_path);
    imagecopymerge ( $original, $watermark, 0,0,0,0, $watermark_width, $watermark_height, $opacity);
    header('Content-Type: image/jpeg');
    imagejpeg($original);
    exit;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

just wondering if someone can help me make this code work properly and be
I was wondering if someone can help me out - working on a bit
I am wondering if someone can explain why dispatching back to the main queue
I was wondering if someone can help me out with this issue. I have
I'm a pretty new C# programmer. I was wondering if someone can fill me
I am wondering if someone could explain how I can utilise tags in an
I was wondering if someone could provide some insight to as why when I
I was wondering if someone can explain how can a rails application be balanced.
I have a Python script and I was wondering how I can make it
Wondering if someone can tell me why this regular expression doesn't work. Expression ->

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.