header('Location: ../pages/my-files.php?pare开发者_StackOverflownt_id=' . $_POST['parent_id']);
The above needs to redirect the user when a form is submitted, using a hidden variable for _parent_id
.
However for some reason the user is bieng redirected (or seems to be by looking at the browser URL) to simply ../pages/my-files.php
Any ideas?
PS. Im certain that $_POST['parent_id']
has a value.
Have you tried to encode $_POST['parent_id'] for use in a url?
header('Location: ../pages/my-files.php?parent_id=' . rawurlencode($_POST['parent_id']));
But it must be something else because your code looks ok. Are you shure that you are redirecting from that point and not from another? Have you tried putting a die() just before that redirection?Most of the times i had your problem i wasn't redirecting from the right place!
精彩评论