I have a simple PHP script, which uses sessions. Most times it works, but sometimes it will not be executed (no errors, just no execution). Without using sessions it works everytime.
@ScleppelJul 08.2005 — #Maybe you could try isset() : [code=php] if (isset($_POST['zurueck'])) // instead of if ($_POST['zurueck']=="zurueck")
// and
if (isset($_POST['weiter'])) // instead of if ($_POST['weiter']=="weiter") [/code] because then the actual value of the POST variable doesn't matter.
EDIT: You should also put else{} at the end for when people don't post anything to the script. [code=php] else{ echo 'Error: You have to POST from a form to this page'; } [/code]
@langhaarauthorJul 08.2005 — #Sorry, there's some misunderstandung.
The script works well but sometimes it will not be executed. That is the reason, why I don't think, it has to do direrctly with the script. Maybe some caching prevents it from being executed?
But thanks for the isset advice. This looks better than my solution :-)
(An else branch is not needed because the script can only be entered by the two buttons)
@ScleppelJul 08.2005 — #What do you mean by no executing? A blank output? A blank output from your script would just mean $_POST['zurueck'] didn't equal "zurueck" and $_POST['weiter'] didn't equal "weiter". If you add an else it would show the error if this is the case. And i can get to you script without clicking the buttons, just a quick veiw source, i'm not saying i would, but someone might and not get what they're expecting or something.