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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:10:17+00:00 2026-05-17T18:10:17+00:00

Greeting Overflowers, I am asked to code an email tracker using PHP. Email clients

  • 0

Greeting Overflowers,

I am asked to code an email tracker using PHP.
Email clients request my PHP script thinking it is an image (BODY’s background).
However, the client (namely Outlook 2007) hangs then (showing nothing) until my PHP script reaches its timeout.

<?php
define("DB_FILE", "sqlite:C:\wamp\www\database.sdb");
define("QUERY", "INSERT INTO Receipt (counter_id, reader_id, start_time, end_time) VALUES (%s, \"%s\", %d, %d)");
define("TIME_OUT", "10");

function track() {
    global $counter_id;
    global $reader_id;
    global $start_time;

    $end_time = time();

    $db = new PDO(DB_FILE);
    $db->exec(sprintf(QUERY, $counter_id, $reader_id, $start_time, $end_time));
}

$counter_id = $_GET["counter_id"];
$reader_id  = $_SERVER["REMOTE_ADDR"];
$start_time = time();

set_time_limit(TIME_OUT);
register_shutdown_function("track");

while(!connection_aborted()) {
    echo "\n";
    ob_flush();
}
?>

It is the loop which should keep the HTTP connection alive for the period of client’s reading the tracked email.
Any thoughts on how to solve this ?

Regards

  • 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-17T18:10:18+00:00Added an answer on May 17, 2026 at 6:10 pm

    I’m afraid there’s no sensible way of telling how long somebody has spent looking at an email. Mail clients simply aren’t designed with that kind of data gathering in mind, and trying to force a network connection to stay open will merely cause the kind of problems you’ve run into.

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

Sidebar

Related Questions

if yes, why this code doesn't alert anything? <html> <head> <script type=text/javascript> switch (hello
Background: for my computer science class, we were asked to create a program that
Greetings Overflowers, To my understanding (and I hope I'm not right) changes to indices
Greetings Overflowers, Users execute transactions, transactions execute queries, queries execute index operations. I've limited
I'm using Google App Engine with python. And I can't install third party library.
I've searched everywhere for a solution to this...even Google's own code example doesn't work.
Why won't it shuffle the array so I get a random result each time?
I'm currently collaborating with a colleague on a project and we both use Vim
I'm having some trouble with subroutines, namely the sort function being used to sort
This is my Controller // No direct access defined( '_JEXEC' ) or die( 'Restricted

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.