invisionx Posted May 30, 2007 Share Posted May 30, 2007 Alright i got this login script from a guy and i want to add a few features to it which is Ip Logging, 3 failed login and cant login for 30 mins, and Online users (also includes how many Visitors are on the site and stuff like that). I seen that you had a Online users Tutorial but for some reason it wouldnt work on my script i might have done something wrong. and the 3 failed logins thing i found a tutorial but i couldnt figure it out. and finally i havent found a tutorial on ip logging can someone help me with these 3 things please Thank you invisionx Quote Link to comment https://forums.phpfreaks.com/topic/53599-php-login-help/ Share on other sites More sharing options...
iLLeLogicaL Posted May 30, 2007 Share Posted May 30, 2007 Posting the script you use would already help the most of the people here :-) Quote Link to comment https://forums.phpfreaks.com/topic/53599-php-login-help/#findComment-264958 Share on other sites More sharing options...
invisionx Posted May 30, 2007 Author Share Posted May 30, 2007 sorry just woke up i should have remembered that one. <a href="69.66.94.187/loginhelp/login_form.php <a href="69.66.94.187/loginhelp/checkuser.php didnt want to post them in here since they are pretty long.. Quote Link to comment https://forums.phpfreaks.com/topic/53599-php-login-help/#findComment-264973 Share on other sites More sharing options...
iLLeLogicaL Posted June 2, 2007 Share Posted June 2, 2007 Posting html in a post doesn't work on most forums, thank god for that or XSS would be to easy. Use [url]url[/url] And you really need to post the source code or rename the file to a .txt extension or the server would just render it Quote Link to comment https://forums.phpfreaks.com/topic/53599-php-login-help/#findComment-267024 Share on other sites More sharing options...
invisionx Posted June 2, 2007 Author Share Posted June 2, 2007 i accually used the url and also i had the site up for 2 days its my test server and also i know how to make it where people can view the script all you need is macromedia just start a new document and click on Design and insert your code then click on Code and it will be in html format so that people can see your code checkuser.php <? /* if (isset($_COOKIE['user_name'])) { $user_name = $_COOKIE['user_name']; } else { */ $user_name = $_POST['user_name']; /* } if (isset($_COOKIE['password'])) { $password = $_COOKIE['password']; } else { */ $password = $_POST['password']; // } if ((!$user_name) || (!$password)) { echo '<center><font class="txt">Please enter ALL of the information!</font></center><br><br>'; include 'login_form.php'; return; } $sql = mysql_query("SELECT * FROM users WHERE user_name='$user_name' AND password='$password' AND activated='1'"); $login_check = mysql_num_rows($sql); if ($login_check > 0) { while($row = mysql_fetch_array($sql)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } session_register('userid'); $_SESSION['userid'] = $userid; session_register('user_name'); $_SESSION['user_name'] = $user_name; session_register('email_address'); $_SESSION['email_address'] = $email_address; session_register('msn'); $_SESSION['msn'] = $msn; session_register('aim'); $_SESSION['aim'] = $aim; session_register('yahoo'); $_SESSION['yahoo'] = $yahoo; session_register('show_email'); $_SESSION['show_email'] = $show_email; session_register('show_msn'); $_SESSION['show_msn'] = $show_msn; session_register('show_aim'); $_SESSION['show_aim'] = $show_aim; session_register('show_yahoo'); $_SESSION['show_yahoo'] = $show_yahoo; session_register('about_me'); $_SESSION['about_me'] = $about_me; session_register('special_user'); $_SESSION['user_level'] = $user_level; session_register('last_login'); $_SESSION['last_login'] = $last_login; /* if (isset($_POST['rememberme'])) { setcookie("user_name", $user_name, time()+60*60*24*100, "/"); setcookie("password", $password, time()+60*60*24*100, "/"); } */ mysql_query("UPDATE users SET last_login=now(), online_time=now(), WHERE userid='$userid'"); header("Location: ../index.php?pages=members_news"); } } else { echo '<center><font class="txt">You could not be logged in, Either the username and password do not match or you have not validated your membership.<br><br>Please try again!<br><br></font></center>'; include 'login_form.php'; } ?> login_forum.php <?php if(isset($_SESSION['user_name'])){ header("Location: index.php?pages=login_success"); } else { ?> <form action="../index.php?pages=checkuser" method="post" name="" id=""> <table width="42%" height="20" border="0" cellpadding="2" cellspacing="0" bgcolor="#CFC095" class="Header_box" align="center"> <tr> <th align="center" bgcolor="#514833" class="background_head">Login</th> </tr> </table> <table width="42%" border="0" cellpadding="2" cellspacing="0" bgcolor="#CFC095" class="Box_border" align="center"> <tr> <td width="47%" valign="top" bgcolor="#4D4531" class="background">Username</td> <td width="53%" valign="top" bgcolor="#4D4531" class="background"><input name="user_name" type="text" id="user_name" class="input-box"></td> </tr> <tr> <td width="47%" valign="top" bgcolor="#4D4531" class="background">Password</td> <td width="53%" valign="top" bgcolor="#4D4531" class="background"><input name="password" type="password" id="password" class="input-box"></td> </tr> <tr> <td width="47%" valign="top" bgcolor="#4D4531" class="background">Remember Me</td> <td width="53%" valign="top" bgcolor="#4D4531" class="background"> <div align="left"> <input name="rememberme" type="checkbox"> </div> <div align="right"></div> </td> </tr> <tr> <td width="47%" valign="top" bgcolor="#4D4531" class="background"> </td> <td width="53%" valign="top" bgcolor="#4D4531" class="background"><div align="right"> <input type="submit" name="Submit" value="Submit" class="submit-button"> </div></td> </tr> </table> </form> <table width="23%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="right" class="txt"><a href="../index.php?pages=sendpassword">Forgoten your password?</a></div></td> </tr> </table> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/53599-php-login-help/#findComment-267036 Share on other sites More sharing options...
iLLeLogicaL Posted June 2, 2007 Share Posted June 2, 2007 :-XThat code is bogus So I will post a script that keeps tracks of visitors http://www.phpit.net/article/creating-whosonline-script-php/ Tada Use Search next time And get a decent login script, you might want to start simple tough Quote Link to comment https://forums.phpfreaks.com/topic/53599-php-login-help/#findComment-267044 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.