Home >Backend Development >PHP Tutorial >js+php realizes the method of real-time calling of user login status in static page, static page user login_PHP tutorial
js+php realizes the method of real-time calling of user login status in static page, static page user login_PHP tutorial
WBOYOriginal
2016-07-13 10:10:17914browse
js+php realizes the method of real-time calling of user login status on static page, user login on static page
The example in this article describes the method of js+php to realize real-time calling of user login status in static pages. Share it with everyone for your reference. The specific analysis is as follows:
In program development, the page is often made into a static form of HTML, which can reduce the server load. However, there is also a problem that when a registered user logs in, a prompt that the login is successful or requires login must be displayed on the HTML page. In this way, we must think of other ways to achieve it. Below we use js+php to implement the example. Of course, ajax can also be implemented. The code is as follows:
Copy code The code is as follows:
The static page calls the user login and logout procedures in real time (the web page special effects call the php code)
loginajax.php file, because loginajax.php is called and output in js format, so the code in this file can be displayed correctly because it is output in js format. The code is as follows:
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/937092.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/937092.htmlTechArticlejs+php realizes the method of real-time calling of user login status in static page. The example of static page user login in this article tells about js+ PHP implements a method for static pages to call user login status in real time. Share...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn