You are here: Reentrant POST hangs the session « PHP Programming Language « IT news, forums, messages
Reentrant POST hangs the session

Posted by a on 11/17/29 11:39

I already posted on this subject, but I have some more information that
should make the issue clearer.

Config: Apache 2.x, PHP 5.1.x, Windows XP Pro

A php script processes a form. Inside this script I call exec to run a
Windows process. If I press the submit button on the form repeatedly, exec
starts and exit the process several times, but after 2-3 cycles, it starts
the process, the process exits, but exec doesn't return, and it hangs the
script and the session forever - it won't even timeout.

I tried to block multiple POSTs by using a global var:

if( isset( $_SESSION[ "processing" ] ) )
{
// 1
exit;
}
else
{
$_SESSION[ "processing" ] = true;
exec( ...);
unset( _SESSION[ "processing" ] );
}

but the script never reaches //1.

I am totally confused by this reentrancy issue and I don't know how to
handle:
1. multiple posts while the script is still running, to avoid hanging the
session
2. offering the ability to cancel the processing, if the process takes a
long time.

One of the requirements is that all processing happen on the server, so no
JavaScript is allowed.

A related question - can multiple php scripts run simultaneously in the same
session -if a user presses submit multiple times, does this run new instance
of the script for each POST?

I would really appreciate any help.

Thanks,

A

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация