Reseller Domain Murah dan termurah di Indonesia? ya di ResellerCamp.
         
 

Forum PHP Indonesia

 
Advanced Search
   
 
Home Register FAQ Memberlist Usergroups  
 
 

Forum PHP Indonesia Forum Index Session & Cookie help cara bikin login 2user
Display posts from previous:   
      All times are GMT + 7 Hours  

help cara bikin login 2user

Post new topic  Reply to topic

Thu Sep 09, 2010 01:42
Author Message
entong
Anak Baru
Anak Baru


Joined: 09 Sep 2010
Posts: 1

Post subject: help cara bikin login 2user Reply with quote

om cara login dengan 2 user berbeda gmn ia
mksdnya jd 1 user untuk memesan
dan user ke 2 tuh ky admin gth yg cm bisa liat sapa aja yg memesan
maklum masih newbie....hihih.... Cry
 
View user's profile Send private message Yahoo Messenger
      Back To Top  

Thu Sep 09, 2010 13:01
Author Message
adiputra
PHP Master
PHP Master


Joined: 22 Oct 2008
Posts: 184
Location: Bandung

Post subject: Reply with quote

pelajari konsep database dan session mas,,

bedakan status user di table databasenya dengan status user dan status admin,,maksud status itu field dari table ya..

ato sekalian bedain tablenya...
_________________
Adiputra's Blog
 
View user's profile Send private message Visit poster's website
      Back To Top  

Thu Oct 14, 2010 19:42
Author Message
monicadanesa
PHPnewbie
PHPnewbie


Joined: 17 Feb 2010
Posts: 8
Location: bandung

Post subject: Reply with quote

brarti itu tuh dalam satu table user aj ya?
klo tablenya ada dua table admin dan user biasa gmn?ap smuanya d masukin dalam satu table aj ?
 
View user's profile Send private message Yahoo Messenger MSN Messenger
      Back To Top  

Fri Oct 15, 2010 19:34
Author Message
adiputra
PHP Master
PHP Master


Joined: 22 Oct 2008
Posts: 184
Location: Bandung

Post subject: Reply with quote

iya mas,,dalam satu table..tp inget ada statusx..

bisa aja 2 table tp kayanya kurang praktis..

masing-masing style codingnya..yg penting mas paham alur logikanya...
_________________
Adiputra's Blog
 
View user's profile Send private message Visit poster's website
      Back To Top  

Fri Oct 15, 2010 22:37
Author Message
poet_noer
PHP Master
PHP Master


Joined: 24 Jan 2008
Posts: 349
Location: jakarta

Post subject: Reply with quote

ini ane kasih gambaran paling simplenya aja ya
contoh ada suatu tabel namanya tabel user
kolomnya => id,username,name,password,hakakses
isinya =>1,user,12345,fulanah,user
=>2,admin,12345,fulan,admin
Quote:

//menerima data dari form login $_POST['username'] & $_POST['password']

$username = $_POST['username'];
$password = $_POST['password'];

//query pengecekan skaligus mengambil data user yg login

$q = 'select * from user where username = "'.$username.'" and password = '.$password.';
$query = mysql_query($q);
$data = mysql_fetch_array($query);

if(count($data)>=1)://jika ada
$_SESSION['hakakses'] = $data['hakakses'];//admin atau user yg login
endif;

$gethalaman = 'halaman_'.$_SESSION['hakakses'].'.php';
//redirect ke halaman admin/user
header('location : '.$gethalaman);
[/quote]
_________________
<?php echo "Write Less Do More";?>
 
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
      Back To Top  

Thu Dec 30, 2010 21:25
Author Message
musicanda
PHP Master
PHP Master


Joined: 02 Jun 2010
Posts: 263
Location: Rumahnya Angeline

Post subject: Re: help cara bikin login 2user Reply with quote

entong wrote:
om cara login dengan 2 user berbeda gmn ia
mksdnya jd 1 user untuk memesan
dan user ke 2 tuh ky admin gth yg cm bisa liat sapa aja yg memesan
maklum masih newbie....hihih.... Cry



tambahkan field "level" di tabelnya, sebagai penanda user dan admin... dan cek di kueri ES KUE EL (SQL) nya mas... Big Smile
 
View user's profile Send private message Send e-mail Visit poster's website
      Back To Top  

Sun Jan 02, 2011 20:15
Author Message
hamzic05
PHPuser
PHPuser


Joined: 06 Oct 2010
Posts: 43
Location: Yogyakarta

Post subject: Reply with quote

sexan nanya kak,maksud dari script ni ap y??
Code:
<?php "'.$username.'" and password '.$password.'?>
maf log masuk room orang,cz ane juga lagi new bie .:o
 
View user's profile Send private message Yahoo Messenger
      Back To Top  

Wed Jan 05, 2011 17:06
Author Message
whois
PHPuser
PHPuser


Joined: 31 Dec 2010
Posts: 40

Post subject: Reply with quote

Masternya lagi pada iburan, ane jawab takut salah maklum newbie juga
_________________
www.whoisdomain.net
 
View user's profile Send private message Visit poster's website
      Back To Top  
Post new topic  Reply to topic

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


      Back To Top  

Page 1 of 1
Jump to:  
Powered by phpBB © 2001, 2002 phpBB Group
Toko Kaos Couple | Avalanche style by What Is Real © 2004 | Toko Baju Butik Online | Cara Pedia | Busana Baju Muslim