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

Greetings, Overflowers! I am writing an application in PHP that will allow for editing
Greeting Everyone I'm trying to compile and run a multi-language code in C, C++
Greeting, how is possible to determine from captured packets using sharppcap if the packet
Greeting, I'm using jquery Plugins/Validation library. I want to allow validation on submitting but
Greeting, I'm trying to put some Beanshell script in my Ant build.xml file. I've
I'm trying something like this Output.py print Hello Input.py greeting = raw_input(Give me the
Greetings all, I'm trying to localize a .NET/C# project. I'm using string resource files
Greetings, The VBA code below will create an Excel QueryTable object and display it
Greeting, I'm a C# programmer guy. I'm planning to start developing app for iphone
Greeting, I would like the jqueryui datapicker to use polish localization. Additionally, the dates

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.