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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:04:27+00:00 2026-06-04T21:04:27+00:00

I have a problem with a trackingpixel. The trackingpixel is included on the main

  • 0

I have a problem with a trackingpixel. The trackingpixel is included on the main page like that:

<img src="tracking.gif" alt="" />

The tracking.gif contains the following:

<?php
header("Location: http://www.mydomain.com/referrer.php?url=http%3A%2F%2Fwww.external.com")
?>

The referrer.php looks like that:

<?php
$url = $_GET['url'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Referring...</title>
        <link rel="stylesheet" type="text/css" href="css.css" />
        <meta http-equiv="refresh" content="0.3; URL=<?php echo $url ?>" />
        <script type="text/javascript">
                    window.setTimeout(function() {
                        location.href = '<?php echo $url ?>';
                    }, 300);
        </script>
    </head>
    <body>
        Some text.
    </body>
</html>

Unfortunately the redirect to the external website doesn’t work. Only the referrer.php gets loaded. Why is that?
The code works if I replace the referrer-url in the tracking.gif by the url of the external website.

More Info:
If I call the referrer.php directly, it’s working.
And I set the server via htaccess that it shoud handle the tracking.gif as a php-file.

Thanks for your help in advance!

  • 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-04T21:04:28+00:00Added an answer on June 4, 2026 at 9:04 pm

    The answer to your question lies in how browsers handle assets of different types, and what assets are allowed to actually do.

    Your first piece of code:

    <img src="tracking.gif" alt="" />
    

    Tells the browser to load and display an image from some location. In order to do that, it’s going to make an HTTP request for the image. This is why your second piece of code:

    <?php header("Location: ....") ?>
    

    actually works. The browser sends an HTTP request for tracking.gif, and the response directs the browser to another location. This is all fine (although you should also be setting the response status to 302 for completeness) and the browser goes off to your new URL in search of image data.

    Here’s we we hit the problem. When we follow the redirect to our new page, we don’t get an image back- we get some HTML. The browser can’t interpret this as an image. It appears to be nonsense. And so it is discarded. The browser certainly isn’t going to check for, or execute, code embedded in the nonsense image data. It’s simply going to hand the data to the pipeline responsible for drawing images, which will then say “I don’t understand this” and move on to the next task.

    This is why your referrer.php page actually works when you load it directly in the browser – because the browser is expecting HTML and Javascript. When the same data is received by the browser is expecting an image, the result is failure.

    It appears that you’re trying to cause the browser to go to a different URL when an image loads, which isn’t permitted by the security model – image files cannot inject behaviour into pages that include them. Can you unpack what you’re actually trying to achieve in a little more detail?

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

Sidebar

Related Questions

I have problem with Activities navigation, searching works good. Activities hierarchy looks like that:
I have problem with fancybox. I want to write a function that will run
I have problem with cakephp's Session->write method. If I set a value like $_SESSION['..']
i have problem with libhid . i found that there 2 way 4 accessing
i have problem with jquery submit and post. I would like to submit a
I have problem witch change style border-left-color in next button, if main button is
I have problem with php's preg_match.I want to make something like this : When
I have problem like this https://dev.twitter.com/discussions/4563 if (webResponse.Headers[Content-Encoding] == gzip) { byte[] bytes =
I have problem with following query: SELECT g_contac.contid, g_contac.name, g_contac.email, f_sync.foreign_key, ( SELECT COUNT(g_cpers.cpersid)
I have problem in some JavaScript that I am writing where the Switch statement

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.