This piece is in the statement page div We specify the ID can be
The code is as follows |
Copy Code |
<div id= "Ajaxlogin" > </div> |
Now let's do a dynamic ajaxlogin.php to determine if the user is logged in
ajaxlogin.php
The code is as follows |
Copy Code |
? Session_Start (); if ($_session[' u_login ']== ' Turelogin ') { Echo ' Here shows what you want to display in the Ajaxlogin in the HTML page '; } Else { Echo ' Displays a message that is not logged in the Ajaxlogin div '; } ?> |
Okay now HTML page and PHP are done we use jquery+ajax/"target=" _blank ">jquery Ajax in the load to instance,
The code is as follows |
Copy Code |
<script src= "/js/v2/jquery-1.7.2.min.js" language= "JavaScript" type= "Text/javascript" ></script>
<script> $ (' #ajaxlogin '). Load (' ajaxlogin.php?a= ' +math.random ()); </script> |
Put on the back of your ajaxlogin can be, do not put in Ajaxlogin before Oh, otherwise it will fail to load, so that our HTML page real-time login information is completed.