I have an entry page that asks for a name and password if the user is registered.
Guests go straight to the chat as a guest.
Registered users can be of two types - regular users or OP's.
The name/password checking uses a simple MySQL database.
Guests have null status, regular registered users have a status of 0, while OP's have a status of 1.
By posting the password and the status in a session, it is carried to the chat page, in my case chat.php -> the default is index.php, I guess
If the status is null, a Please Register button appears.
If the status is 0, nothing appears.
If the status is 1 however, an Identify button appears.
The password is $px
The status level is $sx
This goes at the top of the chat page, before the <body> tag
- Code: Select all
<script language="javascript">
function popUp2(URL) {
eval(window.open(URL, 'popUpWindow', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=440,height=400,left = 100,top = 60'));
}
</script>
This goes after the chat load sequence; if you are not sure, paste it at the bottom of the page, before the </body></html> tags
<chat.php>
- Code: Select all
<?php
if (empty($px)) {
// no password means a guest
echo "<a href=javascript:popUp2('register.php')><img src=themes/default/images/register-on.gif alt=Register align=absmiddle></a>";
} else {
// not a guest then, but what status?
if ($sx == 1) {
include "ident.php";
} else {
// do nothing
}}
?>
create a new page called ident.php
<ident.php>
- Code: Select all
<div class="pfc_btn">
<img src="themes/default/images/ident-off.gif" width="30" height="30"
alt="Identify" title="Identify"
id="pvtmsg"
onClick="pfc.sendRequest('/identify <?php echo $px; ?>')" />
</div>
An OP only has to click a button, and my ladies can do that easily enough
