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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 24-02-2005, 12:20 PM
marco's Avatar
Novice Webmaster
 
Join Date: Sep 2004
Location: Shah Alam
Posts: 43
Rep Power: 0
marco is on a distinguished road
Send a message via MSN to marco Send a message via Yahoo to marco
PHP: LOgin for multiple user

Saya nak buat satu login utk ke page yang lain di mana setiap user yang log in itu akan direct ke page yang berlainan.. using php..

Ok, jika A login dan dah diauthenticate.. dia akan ke page 1, manakala jika B login, dia akan ke page 2.. aku setkan satu username itu khas utk sesuatu page tu. Kena guna database jugak ker sebab kebanyakan apa yang aku search semua login untuk page yang sama... camner tu? maner nak godek.. kalau ade sesiapa yang boleh tolong aku? how can it be done actually...
__________________
regards,

Blog : The Living Earendur
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 24-02-2005, 04:37 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 118
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
maybe you can do like this... In the database, set the redirect location in the user table:

username password location
======= ======= ======
a 123 a.htm
b 321 b.htm

if login successful, get the location and redirect the user to the location.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 25-02-2005, 12:09 AM
mysticmind's Avatar
Super Moderator
 
Join Date: Jun 2001
Location: Mystic Kingdoms
Posts: 2,687
Rep Power: 145
mysticmind will become famous soon enough mysticmind will become famous soon enough
Send a message via Yahoo to mysticmind
Marco,
seelok2nya semua main dengan database lah..
macam contoh yang LCF bgtau tu.

erm.. kalau dalam normal script yang ada sekitar kita nih.. bebenda camni lebih kepada USER LEVEL..
contohnya cam members = nampak lain, admin plak ada link kepada adminpage kan?

tanpa database pun boleh buat.. tapi leceh laa.. banyak bende ko nak masukkan dan mungkin kureng selamat.
contohnya... (aku karang sesuka hati jer nih code, jangan ko pakaiguna sebab kebarangkalian tak jadi tuh banyak )
PHP Code:
if ($nick=="marco" && $pass="1234") {
include(
'adminview.php');
// or some code here-lah
}
if (
$nick=="lcf") && $pass="5678") {
// include some page or coding here
echo "Hey LCF, how r u doing!";
echo 
"go to : MESSAGE - LINK B - LINK C";

else{
echo 
" sorry, members only ";

tuh contoh jer laaa..
trace username ngan password (tanpa database) tuh boleh pakai jugak..
aku tak ingat by detail lar.. try tgk2 sesapa sini biasa.. err MHR
__________________
Personal's Blog! - Malaysian Artist!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 25-02-2005, 09:02 AM
marco's Avatar
Novice Webmaster
 
Join Date: Sep 2004
Location: Shah Alam
Posts: 43
Rep Power: 0
marco is on a distinguished road
Send a message via MSN to marco Send a message via Yahoo to marco
Thanx.. but..

Quote:
Originally Posted by lcf
maybe you can do like this... In the database, set the redirect location in the user table:

username password location
======= ======= ======
a 123 a.htm
b 321 b.htm

if login successful, get the location and redirect the user to the location.
LCF, how to redirect the page for each user? I dont get it. can u explain a litle bit?

mysticmind.. i'll tried to use database in this case but i do not understand how it can be done as what LCF stated..
__________________
regards,

Blog : The Living Earendur
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 25-02-2005, 10:25 AM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 118
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
Let's say the user is authorized with correct username password, and the location value is saved in $location

You can use the following code to redirect user after authorized:
PHP Code:
<?php header("Location: " $location); ?>
Note: cannot have any output before header()
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 25-02-2005, 05:19 PM
marco's Avatar
Novice Webmaster
 
Join Date: Sep 2004
Location: Shah Alam
Posts: 43
Rep Power: 0
marco is on a distinguished road
Send a message via MSN to marco Send a message via Yahoo to marco
ok

ok LCF.. i'll try.. then i'll show the output..
__________________
regards,

Blog : The Living Earendur
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 30-04-2005, 03:58 AM
naero's Avatar
Novice Webmaster
 
Join Date: Mar 2005
Location: Kay Ell
Posts: 28
Rep Power: 0
naero is on a distinguished road
aku rase ko download je script login kat sini...

pastu ko edit je sendiri...ade admin system..

http://www.naero.net/login.zip
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
login annuR Website Programming 2 18-05-2006 02:32 PM
session login sheismaria Website Programming 2 18-05-2006 02:20 PM
login php with session boby Website Programming 3 18-08-2005 04:20 PM
Tulun Aku.. Camner nak wat user login kat ASPX aaa thorax_101 Website Design 3 09-07-2005 10:10 PM
checking multiple emails from multiple domain mrbadak Mamak Stall 4 28-06-2005 08:59 PM


All times are GMT +8. The time now is 01:50 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 61