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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-10-2003, 09:57 AM
Novice Webmaster
 
Join Date: Sep 2003
Location: gombak
Posts: 29
Rep Power: 0
selamba_warrior is on a distinguished road
Send a message via Yahoo to selamba_warrior
sebentar yer

aku nak minta tulun nie
i) aku tgk cari coding utk create web site,aku dah create interface cume nak masukkan php jer supaya bile user enter username n password die boleh masuk n klu die tak de username n password die kene register...bile user dh ade username n password and after registration success user leh terus pegi tempat yg aku tetapkan....ni kire first time aku nak buat cam tu..ade sesape leh tulun aku takk...sbb dah lame aku mencari ni...

ii)aku tertarik gak nak buat cam webmastermalaysia ni punya forum...tp aku tak nak buat forum cume aku nak buat user leh letakkan document or file kat web site aku n then org yg nak bace or amik or modify leh download jerk...cam ne nak buat....tulun ler keje dah lame tertunggak
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-10-2003, 11:22 AM
white_neck's Avatar
Senior Webmaster
 
Join Date: Jan 2003
Location: dreamland
Posts: 240
Rep Power: 75
white_neck is on a distinguished road
Send a message via Yahoo to white_neck
aku bagi ko ringkasan jer la... aku assume ko tau ler cammana nak buat form ngan buat connection ngan database.. ok..

1) kalau nak buat login tuh... mula2 ko kena buat form untuk user inputkan username ngan password.... pastu biler user submit jer form tu... dier akan dihantar ke page lain atau ke page itu juga ( $php_self; ).... kat page tu plak ko buat verifying user name ngan password tu... sama tak, unvalid atau valid.... ko amik data daripada database... tak kisah ler ko nak guna database ke flat file ker atau mmg dah ader kat coding... pastu ko bandingkan dengan username ngan password yg user masukkan tuh.. kalau valid g ler page lain.... kalau tak valid, ko papar le msg ke aper ke...

ini some link yg ader kaitan:
http://www.zend.net/zend/tut/authentication.php
http://www.hotscripts.com/Detailed/12870.html
http://www.zend.net/zend/tut/tutorial-delin4.php

aku tak tgk pun link ni... ko tgk ler.. sbb aku just amik pastu terus kasi ko hihihik

pasal nak daftar tu pun same jer.. ko kena buat form yg mintak details user.... pastu biler user submit terus simpan semua data tu kedalam database.... n then same cam kat atas nyerrr...

2) aku ader cerite pasal uploading ngan downloading ni kat forum.. aku rasa ko jugak ler yg tanya.. aper la...

link dier
cam ner ye

ok la.. tu jer la yg dpt aku bantu... tp kalau pasal login tu aku rasa banayak kat internet... ko buat ler research dulu... ok
__________________
^_^ <== stay happy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-10-2003, 05:25 PM
Novice Webmaster
 
Join Date: Sep 2003
Location: gombak
Posts: 29
Rep Power: 0
selamba_warrior is on a distinguished road
Send a message via Yahoo to selamba_warrior
yukzzz..mmg aku yg tnye, tp aku still confius yg ko tulis directory mane yg ko nk upload....cube cite detail sikit pasal upload n download tue...aku dh cube tp coding download jerk cam jd tp tak jd..
utk yg username n password tu, aku dah create interface sume dah...ade ler box utk user masukkan name n password n klu tak register leh register.....tp mcm mane kite nk buat coding yg bile kite register jerk die dah tau username kite dh ujud, n leh proceed ke page seterusnyer.....kire aku tak paham cam ne flow die
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-10-2003, 05:40 PM
Novice Webmaster
 
Join Date: Sep 2003
Location: gombak
Posts: 29
Rep Power: 0
selamba_warrior is on a distinguished road
Send a message via Yahoo to selamba_warrior
lg satu ...cam ne nak verifying username n password tue
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-10-2003, 11:41 AM
white_neck's Avatar
Senior Webmaster
 
Join Date: Jan 2003
Location: dreamland
Posts: 240
Rep Power: 75
white_neck is on a distinguished road
Send a message via Yahoo to white_neck
pasal upload ndownload tu tgk link ni
http://www.webmastermalaysia.com/sh...p?threadid=3079
aku jawab kat sana...
__________________
^_^ <== stay happy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-10-2003, 11:48 AM
white_neck's Avatar
Senior Webmaster
 
Join Date: Jan 2003
Location: dreamland
Posts: 240
Rep Power: 75
white_neck is on a distinguished road
Send a message via Yahoo to white_neck
Quote:
Originally posted by selamba_warrior
tp mcm mane kite nk buat coding yg bile kite register jerk die dah tau username kite dh ujud, n leh proceed ke page seterusnyer.....kire aku tak paham cam ne flow die
aku tak paham ler...
maksud ko kalau kiter register dier check sama ader user name kiter tu dah ader org pakai ker belum ker?


pasal verify tu cam ni ler....

PHP Code:
    $db=db_connect();
        
    
$result mysql_query("select kataLaluan from login WHERE namaPengguna = '$namaPengguna'");
        
    while (
$data mysql_fetch_array($result)){
     
$dbkLaluan$data[kataLaluan]; 
    }
    
mysql_close($db); 
    
    if(
$dbkLaluan != $kataLaluan){
            echo 
"<html><head></head><body bgcolor=#FFFFFF></body></html>";
            echo 
"<script>alert(\"SILA MASUKKAN SEMULA KATALALUAN YANG BETULS!!!\");history.go(-1)</script>";    
    } 
lebih kurang camtu ler...
tu yg simple ler.. ader yg advance skit tp panjang siot.. nanti ko tak paham lak... try ler yg ni dulu paham tak?
__________________
^_^ <== stay happy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-10-2003, 12:51 PM
Novice Webmaster
 
Join Date: Sep 2003
Location: gombak
Posts: 29
Rep Power: 0
selamba_warrior is on a distinguished road
Send a message via Yahoo to selamba_warrior
ade lg soalan

okle aku cube lerrrr...tapi aku rase dah clear sikit le mendeyg ko terang tue.....
ade lagi nie
i) ko tgk coding nie:

<?php

if ( ( !isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW))
|| ( $PHP_AUTH_USER != 'user' ) || ( $PHP_AUTH_PW != 'open' ) ) {

header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
exit;

} else {

echo 'Success!';

}
?>
bile aku try jerk die ade error kat header tue...jd aku nak ler header tu utk ape??? n mcm mane aku nak buat bg die tak error.





ii) lg satu, ko view code nie


<?php

// Make sure that the database connection runs only
// after the username and password information have
// been submitted. The username and password
// information are submitted at the end of this script
// but are executed first.


if ($submit) {

$db = mysql_connect("localhost", "username", "password");
mysql_select_db("auth", $db);
$sql = "
SELECT auth_level
FROM auth
WHERE username = '$username'
AND password = '$password'
";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$auth_level = $row["auth_level"];
}

// retrieve the authorization level from the table
// where the username and password are equal to
// the values submitted

if (!mysql_num_rows($result)) {

echo "You are not Authorized for access.";

// if the information doesn't match, i.e. returns
// no records, then they shouldn't be there.

} else {
setcookie('username', $_POST['username'], (time()+2592000), '/', '', 0);
setcookie('auth_level', $_POST['auth_level'], (time()+2592000), '/', '', 0);
}


// otherwise, set their persistent authentication
// with cookies for both username and access level

// Now begin the if/else statements to display the
// appropriate information for their access level.
// This could be supplemented by database retrievals,
// various script redirects or includes.

if ($auth_level == "1") {

echo "You are logged in as a Guest.<br />
<a href='next.php'>Click here for options</a>
";

} elseif ($auth_level == "2") {

echo "You have Member level access.<br />
<a href='next.php'>Click here for options</a>
";

} elseif ($auth_level == "3") {

echo "You have Editor level access.<br />
<a href='next.php'>Click here for options</a>
";

} elseif ($auth_level == "4") {

echo "You have full Administrative access.<br />
<a href='next.php'>Click here for options</a>
";
}

// for each access level, the level is displayed
// as well as the link to the next.php script.
// For expansion, the access level displayed could
// also be stored in a database for dynamic retrieval.


} else {

// if they haven't submitted their username and
// password, then the original form is displayed

?>

<form method="POST" action="<?php echo $GLOBALS ['PHP_SELF'];?>">
Name:<input type="text" name="username"><br />
Password: <input type="password" name="password"><br />
<input type="submit" name="submit" value="Login">
</form>
<?php

// close the script

}
?>

soalan aku arrr...
setcookie tu bg masalah kat aku,bile aku gune setcookie tu mesti ade error...tp bile aku jdkan setcookie tu as a comment....ok jerk
nape leh jd cam tue????ape gune nyer setcookie tue sebenornyer????



setcookie and header() memeningkan aku jerk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 16-10-2003, 10:25 AM
white_neck's Avatar
Senior Webmaster
 
Join Date: Jan 2003
Location: dreamland
Posts: 240
Rep Power: 75
white_neck is on a distinguished road
Send a message via Yahoo to white_neck
yang aku tau cookie nak set cam ni
setcookie("uname", $name, time()+36000);

ko nyer case aku rasa cam ni
setcookie('username', $_POST['username'], time()+2592000);

sbb dier nyer parameter camni
setcookie(name, value, expire, path, domain);

huh.. paham?

header tu lak...
yg aku paham ler... correct me if im wrong...
dier cam bleh jadi redirect user ke page tertentu
contoh...
header("Location: http://www.yahoo.com/");
so biler ko run php tu dier akan redirect kan ko ke yahoo...

case ko lak
ko buang jer header(); tu
sbb aku rasa ko tak pakai...
ok

itu jer dpt aku tolong.. tp kalau ader masalah bgtau jer la..
__________________
^_^ <== stay happy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 16-10-2003, 11:05 AM
MHR's Avatar
MHR MHR is offline
Senior Webmaster
 
Join Date: Sep 2001
Location: epox
Posts: 435
Rep Power: 95
MHR is on a distinguished road
Send a message via ICQ to MHR Send a message via Yahoo to MHR
white_neck, ko ni terlalu murni la. aman dunia ni kalau ade 100 orang lagi cam ko. hehe
__________________
Munzir + "/^[Hh](a)(z)\1\2[iI]$/"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 16-10-2003, 11:16 AM
white_neck's Avatar
Senior Webmaster
 
Join Date: Jan 2003
Location: dreamland
Posts: 240
Rep Power: 75
white_neck is on a distinguished road
Send a message via Yahoo to white_neck
hihihik...
ni kan forum tolong menolong...
hahhaha....
ilmu kena share maaa....
mana aku tau aku tolong ler..
mana aku tak tau korang ler tolong...
hahhahahaha...
tp kalau aku ader silap..
kasi betul la yerk...
aku pun bukan terrer sangat...
haahhahahha
__________________
^_^ <== stay happy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 16-10-2003, 03:24 PM
Novice Webmaster
 
Join Date: Sep 2003
Location: gombak
Posts: 29
Rep Power: 0
selamba_warrior is on a distinguished road
Send a message via Yahoo to selamba_warrior
aku rase ade problem lagi le ngan upload ko tue...
i) tiada sebarang action pon berlaku kecuali pertukaran page jerk tp mende yg aku upload tak masuk pon
ii)bile aku tekan upload walaupun aku tak select file yg aku nak upload die tetap proceed ke page lagi satu n tiada komen pon kuar cth sepatutnya klu kite tak select file jd bile kite tekan upload die akan echo "Must select file to upload kan" tp xde ape pun yg berlaku

ape yg perlu dibuat????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 17-10-2003, 08:36 AM
Novice Webmaster
 
Join Date: Sep 2003
Location: gombak
Posts: 29
Rep Power: 0
selamba_warrior is on a distinguished road
Send a message via Yahoo to selamba_warrior
wehhhhh.....dah settle dah ....
tp aku still tak paham function $dl tue....
kire skrg nie aku jdikan $dl tu sbg //$dl....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 17-10-2003, 09:47 AM
white_neck's Avatar
Senior Webmaster
 
Join Date: Jan 2003
Location: dreamland
Posts: 240
Rep Power: 75
white_neck is on a distinguished road
Send a message via Yahoo to white_neck
$dl tu kalau kat upload, dier mmg tak pakai...
$dl tu pakai dekat download jer....
aku sajer letak sbb project aku sblum ni ader dua2 dlm satu page...

ok.. dah paham dah?... bagus...
tahniah...
hihihik
__________________
^_^ <== stay happy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 17-10-2003, 02:43 PM
Novice Webmaster
 
Join Date: Sep 2003
Location: gombak
Posts: 29
Rep Power: 0
selamba_warrior is on a distinguished road
Send a message via Yahoo to selamba_warrior
heheheehe.....$dl tk digunkan dlm upload....penat aku perah otak cari function dlm upload.....
coding yg ko bg ni, kite leh gunakan utk linux ker sbbnyer
aku gune linux,php,apache n mysql....adakah coding ni compatible "maksud aku leh baca ler" cam kat dlm window????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 20-10-2003, 09:49 AM
white_neck's Avatar
Senior Webmaster
 
Join Date: Jan 2003
Location: dreamland
Posts: 240
Rep Power: 75
white_neck is on a distinguished road
Send a message via Yahoo to white_neck
hahahaha... sori sbb misunderstand kat situ...
pasal linux tu aku rasa takder masalah... <kot la>...
sbb aku pun tak try lg...
pada pendapat aku... dari segi linux baca coding tu bukan pada OS nya... tp pada engine php tuh sendiri... so aku rasa tak de masalah kot.. ko try ler dulu pas tu inform aku yerk...
tq...
__________________
^_^ <== stay happy
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