Jump to content

I need a pop-up chat and php security


gnawz

Recommended Posts

Hi

 

Can someone please help me with my two problems please?

 

 

I have seen lots of code about chats but none is helping me really.

I need to do a chat on my website. This chat should enable individuals chat among themselves; it should however be a poup-up caht like Gmail's or facebook's.

 

 

My other issue is as follows:

 

I have a login section to my site with 3 different access levels.

 

Each user can only see what is at their level after logging in and this works well.

 

However, I need to restrict users from viewing what they shouldn't even if they type the URL.

I mean if a user types a URL into a section where they are not authorised, It should tell them sth like "Yoou nust be logged in to view this area"

 

Can someone help me please?

Link to comment
Share on other sites

the access level depends on how your current member system works but you could beable to do this via a session

ie

<?php
session_start();
if(!isset($_SESSION['loggedin']))
{
die("you must log in first");
}
?>

 

as for the chat, whats the "problem" can you post your code so far

Link to comment
Share on other sites

See my last post

 

the access level depends on how your current member system works but you could beable to do this via a session

ie

<?php
session_start();
if(!isset($_SESSION['loggedin']))
{
die("you must log in first");
}
?>

 

as for the chat, whats the "problem" can you post your code so far

Link to comment
Share on other sites

Thanks.

 

I used this function...

<?

function checkUser()

{

// if the session id is not set, redirect to login page

if (!isset($_SESSION['UserID']))

{

header('Location: ' . WEB_ROOT . 'admin/login.php');

exit;

}

?>

 

where UserID id the user's ID in the database then I call the function at the top of every page I do not want to be seen before logging in.

 

 

For the chat,

I have alot of code for chat some of which is open source.

 

What I want is to have a pop-p chat like the one of gmail of facebook.

 

I need help on how to go about it.

 

The same principle, I need to use as follows:

 

I want a user to to alerted by a popup when a record hits the database, eg a record has been added or some one has logged in.

 

Like when someone logs in to a chat then a pop-up appears to members who are logged in that someone has logged in.

 

Any way to do that?

Link to comment
Share on other sites

You are going to need to learn a decent amount of javascript and html/css to do the pop up.

You will be using css layers and javascript for the most part.

 

If you want the messages to pop in real-time, you are going to need to invest a considerable amount of time learning ajax.

 

Alternativly, and my reccomendation because you don't have the knowledge for what your trying to do, is to start out with a check in php on the page, that checks for new messages on a new page load.

 

The very first thing you need to do is work on those login levels, then work towards make a chat, don't even touch the pop-up idea untill you code a decent chat you can use.

 

This will take a few days for constant coding, but don't give up, you'll get it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.