Home >Backend Development >PHP Tutorial >Static page calls user login and logout procedures in real time (js calls php code)_PHP tutorial

Static page calls user login and logout procedures in real time (js calls php code)_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:08:11775browse

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, so that we We have to think of other ways to achieve it. Below we will use js+php to implement the example. Of course, ajax can also be implemented

The static page calls the user login and logout program in real time (the web page special effects call the php tutorial code)





The static page calls the user login and logout procedures in real time (webpage special effects call php code)





loginajax.php file code

$id = isset( $_get['fid'] )?$_get['fid']:0;
if( !isset($_cookie['vvg']) ){
?>
document.write('Username:');
document.write('');
}
else
{
echo 'document.write('['.$_cookie['realname'],']SpeakExit ');';
}
?>

This article was originally reproduced from http://www.bkjia.com/phper/php.html Please indicate the source, thank you for your cooperation.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/444881.htmlTechArticleIn program development, the page is often made into a static form of html, which can reduce the server load, but it also There is a problem that when a registered user logs in, it needs to be displayed on the html page...
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