2

I'm redirect from one page to the index.php file of the current directory. I'm doing so while setting a GET parameter, and I'd like to do something like the following.

header("Location: ?v=30");

This would be on page2.php, redirecting to index.php?v=30. I know I can fix it by using:

header("Location: index.php?v=30");

but I'd like to keep the URL simpler, and I was hoping there was a way to do it the former way.

1 Answer 1

13

Try this:

header("Location: ./?v=30");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.