redirect to previous page after login php
<p>I would like to know how I can get redirected to the previous page that I was looking at. Let's say I want to go to a page that requires sign in and I get redirected to login and after login I need to get backto that page iinstead of being redirected to home</p>