0

I want to do redirect from my login page to the display profile page, but I don't know how to do it. Many suggested the concept of

header('Location: $location');

but its working only in the beginning part of the code. What if we want to forward it after confirming the username and password?

How about this?

echo"<html><?php header('location:www.google.com'); ?></html>";
bangbambang
  • 345
  • 6
  • 13

1 Answers1

0

In case you still have to echo before your point where you may redirect then I suggest you add ob_start(); at the beginning of PHP script.

refers this answer

Community
  • 1
  • 1
enRaiser
  • 2,606
  • 2
  • 21
  • 39