Php returns to the pre-logon page after logon.

Source: Internet
Author: User
After logging on to php, the system returns to the page before logon. This post was last edited by cntegzs from 2012-11-2716: 45: 39. the following code returns to the page before logon: & lt; A & nbsp; onclickwindow. locationuserlogin. php? Url + encodeURIComponent

This post was last edited by cntegzs at 16:45:39, January 27 ,.

The following code returns to the page before logon:
Login

Because the logon page is:
User/login. php



If the following logon page is displayed:
Index. php? Mod = user & act = login

How can I return to the previous page after logon?
------ Solution --------------------
Index. php? Mod = user & act = login & url = xxx
You can pass the parameter in the GET method,
Of course, your controller must support redirection.
------ Solution --------------------
1. you can save the current url and use cookies on the front-end. there are more background forms, such as session or database or file.
2. link the current url to login,
'Index. php? Mod = user & act = login & url = '+ encodeURIComponent (window. location. href );
After successful login, jump to the path pointed to by this url

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.