gnawz Posted July 22, 2008 Share Posted July 22, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/ Share on other sites More sharing options...
MadTechie Posted July 22, 2008 Share Posted July 22, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/#findComment-596465 Share on other sites More sharing options...
MasterACE14 Posted July 22, 2008 Share Posted July 22, 2008 I don't think he has any code so far :-\ Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/#findComment-596467 Share on other sites More sharing options...
MadTechie Posted July 22, 2008 Share Posted July 22, 2008 Me either.. i that case it should be in the freelance section.. but i like to check first Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/#findComment-596468 Share on other sites More sharing options...
gnawz Posted July 25, 2008 Author Share Posted July 25, 2008 Hi The security I need is to stop users from viewing a page when they type its link in the address bar. eg http://localhost/site/memberarea.php If this page is only viewable after logging in, one should not be able to see it even if one just types that URL. They should get a message forbidding them from viewing the file. Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/#findComment-599541 Share on other sites More sharing options...
MadTechie Posted July 30, 2008 Share Posted July 30, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/#findComment-603559 Share on other sites More sharing options...
gnawz Posted August 7, 2008 Author Share Posted August 7, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/#findComment-610667 Share on other sites More sharing options...
deadlyp99 Posted August 7, 2008 Share Posted August 7, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/#findComment-610677 Share on other sites More sharing options...
gnawz Posted August 7, 2008 Author Share Posted August 7, 2008 I know CSS, HTML and some AJAX I will take my time to learn. Quote Link to comment https://forums.phpfreaks.com/topic/116007-i-need-a-pop-up-chat-and-php-security/#findComment-610764 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.