|
|||
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 |
|
||||
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 hihihikpasal 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 |
|
|||
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 |
|
||||
pasal upload ndownload tu tgk link ni
http://www.webmastermalaysia.com/sh...p?threadid=3079 aku jawab kat sana...
__________________
^_^ <== stay happy |
|
|||
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 |
|
||||
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 |
|
|||
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???? |
|
|||
|
||||
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 |
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|










hihihik

hehe
Linear Mode
