Can't get the redirect to work

I am trying to get the redirect to work but for some reason, it was working before with the first command but not working at the moment. I can only get it working now with the second command instead:

  1. echo “<meta http-equiv=‘refresh’ content='0;url=…/student_registration.php?id=”.$userid.“')”;

  2. header(“Location: header2.php?create_cat_form=notpermitted”);

So… what does it do instead?

It just doesn’t do anything for that page… does not redirect at all but for my other pages, it works…

What would you describe as “doesn’t do anything”? A blank page? An error message? The universe implodes into itself and ceases to exist?

“doesn’t do anything” is not a problem description. Everything always does something. The fact that it doesn’t do what you expect it to do doesn’t mean it’s not doing anything at all.

I just wanted to say lot of things are missing om command 1:

echo “<meta http-equiv='refresh' content='0' url='…/student_registration.php?id=”.$userid."’>";

@anon19508339, code not correct, because url attribute is not valid on the meta tag and you will refresh the actual page (as seen on the meta content of only 0) instead of doing a 302 redirect to ../student_registration.php?id=$userid! And obviously the formatting system on InfinityFree’s forum causes some quotes to be written as they will be without putting them on the code formatting tag/grave accent/quadruple space, and doing so could cause a syntax error. There is the correct code, for you and @piano0011 to see:

echo "<meta http-equiv='refresh' content='0; URL=../student_registration.php?id=".$userid."'>";
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.