<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=gb2312" /> <title>静态页面实时调用用户登陆与退出登陆程序(网页特效调用php代码)</title> </head> <body> <script language="javascript" src="/loginajax.php?fid={fid}"></script> </body> </html>
<?php $id = isset( $_get['fid'] )?$_get['fid']:0; if( !isset($_cookie['vvg']) ){ ?> document.write('用户名:<input type="text" class="pl_sty1" name="username" id="username" />'); document.write('<input name="action" type="hidden" value="login" />'); <?php } else { echo 'document.write('['.$_cookie['realname'],']发言 <a href=/login/login.php?action=logout>退出</a>');'; } ?>
希望本文所述对大家的php程序设计有所帮助。