Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web2py redirect to previous page

When from a page , I goto another page via some hyperlink,is there any way to go back to the previous page. The previous page has some arguments also. SO I want to ask whether the previous page is saved somewhere or is there any other way to go back to that page

like image 348
sahil Avatar asked Dec 29 '22 03:12

sahil


1 Answers

In http there is a header field called "referrer". If present it point to the previous page. You can access it from web2py:

if request.env.http_referer:
    redirect(request.env.http_referer)
like image 187
mdipierro Avatar answered Dec 30 '22 17:12

mdipierro