0

I want to check information received via a url like http://www.example.com/login?name=john&password=1234

And return information as url by redirecting it to If it is right then- http://www.example.com/right

If it is wrong then - /false

  • Use the Header location. Check this answer: http://stackoverflow.com/questions/768431/how-to-make-a-redirect-in-php#768472 – Keloo Apr 29 '17 at 11:58
  • what is right and wrong? any query string passed in URL ? – Murtaza Bhurgri Apr 29 '17 at 11:59
  • 1
    Please do not send sensitive information in the URL, always use `POST` for such kind of requests and pass the information in the request body. See this answer [link](http://stackoverflow.com/a/1744404/5648904) – Lingaraju E V Apr 29 '17 at 12:10
  • Security doesn't matter , also the url will not be visible to user, it will run in background... – Devanshu goyal Apr 29 '17 at 12:55

1 Answers1

0

You can use the header function to redirect the user. The header function allows sending http headers back to the user. For example header("Location: " . $url). Your script should not send output before calling the header function. See this link: https://www.w3schools.com/php/func_http_header.asp

Nadir Latif
  • 3,690
  • 1
  • 15
  • 24