Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 14-12-2006, 02:08 PM
Novice Webmaster
 
Join Date: Aug 2006
Location: Seri Kembangan
Posts: 12
Rep Power: 0
marukochan is on a distinguished road
Access to Members' Page

How do I make a members page accessible only by login page by members only.

My concern is that if the members' page is members.php and someone just type
http://www.xxx.com.my/members.php, then he can just access the page without going thru the login page.

So, my question is how do I make this member page can only be accessed after the user logs in thru login.php.

Help me plz ......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 26-12-2006, 07:11 PM
Novice Webmaster
 
Join Date: Sep 2006
Location: penang
Posts: 20
Rep Power: 0
slier is on a distinguished road
lol..nobody wanna help him....apa la korang ni...

Hello my friends ..u just need to use session to resrict member.php to only registered member....please refer to php manual...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 26-12-2006, 08:32 PM
robot's Avatar
Senior Webmaster
 
Join Date: Jul 2006
Location: My
Posts: 969
Rep Power: 48
robot will become famous soon enough
here is a simple login system for only 1 user

PHP Code:
<?php
session_start
();

  
// PROCESS MEMBER LOGIN
 
if($_POST["username"] && $_POST["password"])
 {
   
//***** CHANGE THIS USERNAME AND PASSWORD TO YOUR PREFERENCE *****
   
$username="admin";
   
$password="pass";
    if(
$_POST["username"]==$username && $_POST["password"]==$password)
    {
setcookie("user",$username,time()+3600); $user=$username; print "Login success <br/>\n";}
    else
    {print 
"Wrong Username and password !<br/>\n";}
 }

// GET COOKIE INFORMATION
if(isset($_COOKIE["user"])){$user=$_COOKIE["user"];}

// PROCESS LOGOUT ACTION
if(!$_POST && $_GET["action"]=='logout')
{
setcookie("user","",time()-3600); unset($user);}

// GET AUTHORITY TO ACCESS MEMBER AREA
if($user)
{

print 
"
Welcome $user <br/>\n
This is the member section information<br/>\n
Only member can view this<br/>\n
<a href=\"?action=logout\">Logout</a><br/>
"
;


}
else
{
 
// DISPLAY MEMBER LOGIN FORM
print "
<form action=\"\" method=\"post\">
Name <input type=\"text\" name=\"username\" size=\"20\"/> <br/>\n
Pass <input type=\"password\" name=\"password\" size=\"20\"/> <br/>\n
<input type=\"submit\" value=\" Login \"/>
</form>"
;
}


?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 19-01-2007, 12:37 PM
Novice Webmaster
 
Join Date: Sep 2005
Location: Selangor
Posts: 11
Rep Power: 0
eisyna is on a distinguished road
Yeah..in login procession page u need to use register_session to display member's profail or some other data info...which connect directly from database..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Say Hello to All members megalang Member Introductions 1 11-11-2006 07:43 AM
Bad news for 12DP members? dlcmh Revenue and Monetization 2 08-02-2006 12:48 AM
ms access to web? khairudin Website Programming 13 15-05-2004 12:19 AM
PHPNuke Tips : Members List mozaks Website Programming 0 20-07-2002 03:43 PM
Members sunshinerocke Mamak Stall 6 01-07-2002 10:53 AM



All times are GMT +8. The time now is 05:41 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60