beginner question about exec()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    #1

    beginner question about exec()

    I have a small custom 404 page in PHP. When this page is triggered I'd
    like some information about the requesting client, including its reverse
    IP. I would like the 404 page to be returned to the client's browser
    immediately, after invoking another function or script that takes care
    of the lookup & email duties. The 404 page doesn't care about the return
    value of the second script at all, it's fine if it fails. It looked to
    me like exec() is appropriate here, is that correct? Am I thinking about
    it wrong?

    Thanks.

  • Michael Fuhr

    #2
    Re: beginner question about exec()

    Peter <phorst@speakea sy.net> writes:
    [color=blue]
    > I have a small custom 404 page in PHP. When this page is triggered I'd
    > like some information about the requesting client, including its reverse
    > IP. I would like the 404 page to be returned to the client's browser
    > immediately, after invoking another function or script that takes care
    > of the lookup & email duties. The 404 page doesn't care about the return
    > value of the second script at all, it's fine if it fails. It looked to
    > me like exec() is appropriate here, is that correct? Am I thinking about
    > it wrong?[/color]

    What happened when you tried it?

    Have your PHP page use exec() to invoke a script that takes a while
    to execute and see what happens. The script could sleep for a few
    seconds to simulate delays from DNS lookups or other work. If the
    results are acceptable then use exec(); if the results aren't
    acceptable then either use another mechanism to invoke the script
    or think of a way to make the script give acceptable results with
    exec(). You'll probably need to know something about how your
    system manages processes.

    If you're having trouble, then post what you tried, what happened,
    what you'd like to happen, and what kind of system you're using.

    --
    Michael Fuhr

    Comment

    Working...