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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 25-07-2003, 10:03 AM
miss_tlot's Avatar
Novice Webmaster
 
Join Date: Jun 2003
Location: Terengganu
Posts: 10
Rep Power: 0
miss_tlot is on a distinguished road
Angry Camana nak buat login

Haii...

saya tengah nak buat login nie...saya dah terai coding kat bawah nie, tapi tak lepas jugak...saya pun tak tau samada semua scripting kat dalam coding nie memang wajib ataupun ada yang boleh dibuang ataupun ada yang tak cukup...sesiapa yang terer tu, tolong boleh?

<?php
/* $Id: login.php,v 1.7 2002/09/03 22:02:01 shaggy Exp $ */

if ($_SESSION['logged']) {
redirect('/user/');
}

require_once 'html_form.php';
$form = new Form(uri_self());

$form->addText('username', 'Username');
$form->addPassword('password', 'Password');
$form->addCheckbox('remember', 'Remember me');

$form->addSubmit('Log in');

$form->addRule('username', 'range:5:20', 'Enter your username, 5 - 20 characters.');
$form->addRule('password', 'range:5:20', 'Enter your password, 5 - 20 characters.');

$form->addFilter('_ALL_', 'db');

if ($form->valid()) {
$processed = $form->getProcessed();
$remember = $form->getValue('remember');

if (!isset($_SESSION['login'])) {
$_SESSION['login'] = 3;
} else {
if ($_SESSION['login'] <= 1) {
die('You cannot log in.');
}
}

if ($user->_checkLogin($processed['username'], $processed['password'], $remember)) {
if (isset($_SESSION['log_to'])) {
redirect($_SESSION['log_to']);
} else {
redirect('/user/');
}
} else {
failed($form);
}

} else {
begin_html();
$form->display();
}

function failed(&$form) {
begin_html();
echo "<p>You could not be logged in, $_SESSION[login] attempts left.</p>
<p>Possible reasons for this are:</p>

<ul>
<li>Your username and/or password is not correct.
Check your username and password and then try again.</li>
<li>You haven't" .
'<a href="/user/signup" title="Sign up for an account, it is free">
registered</a> yet</li>
<li>Your account is temporarily disabled.</li>
<li>You are trying to login simultaneously from two different computers or
two browsers on the same computer.</li>
</ul>';

$form->display();
}
?>
__________________
Tlot
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 25-07-2003, 12:13 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 116
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
user smarty huh? I haven't touch smarty yet :P
What error you get? only cannot login?
where is the "$user->_checkLogin()" function located?
__________________
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-07-2003, 03:41 PM
mysticmind's Avatar
Super Moderator
 
Join Date: Jun 2001
Location: Mystic Kingdoms
Posts: 2,637
Rep Power: 142
mysticmind will become famous soon enough mysticmind will become famous soon enough
Send a message via Yahoo to mysticmind
or the form login input tak match NAME dia dengan $username, takpun input NAME password dia tak match dengan $password..

selalunya berlaku macam nih kalau u design semula form login tuh... dan tak recheck form punya output.

sekian
__________________
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 11-08-2003, 11:55 AM
Senior Webmaster
 
Join Date: Jun 2003
Location: malaysia
Posts: 315
Rep Power: 72
Syazwan is on a distinguished road
erm....perluker buat database kalo kite nak buat login system?

i'm still newbie here
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-08-2003, 12:16 PM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 116
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
yes, u need database
__________________
LiewCF | Malaysia Bloggers Forum
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
mysql: taknak kluar byk2 camana? infeeneetee Website Programming 17 19-09-2005 06:15 PM
Cannot login to Malaysian Top 50 alang Mamak Stall 5 04-02-2004 04:33 PM
::[ LOGiN AREA ]:: pjal_studio FeedBack & Suggestion 3 08-01-2004 07:48 PM
tolong ajar camana nak guna frontpage nak buat web? superrahim Webmaster Tools 0 24-05-2003 11:45 PM



All times are GMT +8. The time now is 10:26 AM. 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