Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
- New php-forum User
- Posts: 3
- Joined: Wed Jan 25, 2012 6:56 pm
I'm having an issue and I can't figure out for the life of me what the problem is.
I've got an AJAX request which parses packets of data to a php script which processes the packet and writes the output to a log.
The whole thing runs perfectly ... unless I put a sleep(rand(2,20)); in the php script which makes it pause for awhile after processing each element in a packet. When I put the time delay in then sometimes in the middle of processing a packet the php script will seemingly stop and restart itself and process the whole packet again.
I've ruled out that the AJAX might be sending the request again while the php script is running by putting a flag in the AJAX so it can't send anything while the phpscript is running.
What could be causing this? I can't find anything about the problem.
Return to “PHP coding => General”
Who is online
Users browsing this forum: Xenoforeks and 2 guests