What do you think and mean by saying "Multiple inserts of the same value"?
You said in the OP:
... another third weird way the script runs sometimes is, that the line is getting inserted 2 times ...
Which I took to mean that the INSERT is executed twice and you end up with two rows in the DB with the same value(s)...?
| [reply] [d/l] |
That's the weird point. I do only have one single execution in my script. There is no loop, just a single INSERT-Execution wirtten in my script. That's why I came to the thoughts of a redirection loop - which I didn't found yet.
| [reply] |
Yes, it's a possibility that your script is executing twice. You said in the OP "the exit is getting ignored" - that is such an unlikely bug that it's practically impossible. So you need to keep track of the state to detect and prevent multiple executions of the script.
Perhaps it's time to develop a test case that reproduces the problem, like a few really short CGI scripts that redirect to each other, similar to what your code is doing now. Post it here so we can help you debug, otherwise we're left guessing and all the debugging is up to you.
| [reply] |