is the query recommended in PHP headers like this example below:
header("location:index.php?id=1");
1-if not , what is the reason ?
2-what is the alternative method ?
Asked
Active
Viewed 72 times
-3

Omar AbdElwahhab
- 91
- 1
- 6
-
There's no reason not to do that. You can use any valid URL. Have you experienced a specific problem? – ADyson Aug 15 '21 at 16:40
-
https://stackoverflow.com/questions/3032643/php-get-request-sending-headers There is a misunderstanding about the third answer in this question , so I wanted to clarify to myself @ADyson – Omar AbdElwahhab Aug 15 '21 at 22:47
-
That question is a about _sending_ a request _from_ your code to some other URL. But `header("location:index.php?id=1")` is about redirecting the response to the current request away from the current script and onto a different URL. These are two different tasks. So...which one are you actually trying to achieve? I believe the answer you're referring to is [this one](https://stackoverflow.com/a/3032652/5947043), but it seems the answerer has misunderstood the question. – ADyson Aug 16 '21 at 05:06