eaglelegend Posted May 14, 2008 Share Posted May 14, 2008 Hey, some guys helped me out with getting my site using MD5 and encrypted from here, thanks you guys, just one more problem, I just get a mobile version, now I need to have the login and register pges md5, if you notice its not here I have to change it, please et me know where and I can get it for you. right... Register: <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Cache-Control" content="no-cache"/> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" /> <link href="di.css" rel="stylesheet" type="text/css" /> <title>Eagle Legend Mobile</title> </head> <body> <div class="navItem2">1. <a href="index.php" accesskey="0">Home</a></div> <p><img src="cp_2.gif" alt="Teen Board" width="100" height="37" /></p> <?php include("ads.php"); ?> Register for your free account<br /> <form action="doregister.php" method="post"> Username<br /> <input type="text" name="u" size="5" /> <br /> Password<br /> <input type="password" name="p" size="5" /> <br /> <input type="submit" value="Register"> </form> </p> <div id="navigation"> <div class="navItem2">0. <a href="index.php" accesskey="0">Home</a></div> </div> <p> <strong>© Eagle Legend MMVIII</strong></p> </body> </html> Login.php: <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Cache-Control" content="no-cache"/> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" /> <link href="di.css" rel="stylesheet" type="text/css" /> <title>Eagle Legend Mobile</title> </head> <body> <div class="navItem2">0. <a href="index.php" accesskey="0">Home</a></div> <p><img src="cp_2.gif" alt="Eagle Legend Mobile" width="100" height="37" /></p> <?php include("ads.php"); ?> <p class="style1">Login<br /> <form action="dologin.php" method="post"> Username<br /> <input type="text" name="u" size="5" /> <br /> Password<br /> <input type="password" name="p" size="5" /> <br /> <input type="submit" value="Login"> </form> </p> <div id="navigation"> <div class="navItem2">0. <a href="index.php" accesskey="0">Home</a></div> </div> <p> <strong>© Eagle Legend MMVIII</strong> </p> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/ Share on other sites More sharing options...
eaglelegend Posted May 14, 2008 Author Share Posted May 14, 2008 can anyone help? :-\ Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541051 Share on other sites More sharing options...
MadTechie Posted May 14, 2008 Share Posted May 14, 2008 unless your asking for html help your need to post the code for ads.php, but then again i am not even sure what your asking! Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541057 Share on other sites More sharing options...
eaglelegend Posted May 14, 2008 Author Share Posted May 14, 2008 to make the login/register MD5, as it dont md5 :/ Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541058 Share on other sites More sharing options...
wildteen88 Posted May 14, 2008 Share Posted May 14, 2008 In that case you'll need to modify the script which performs the login/registration operation which I assume is dologin.php and doregistration.php Looking at your form all you need to do is md5 the $_POST['p'] variable in the files suggested above. The md5 hash will need to be stored in your users table of course this should be done in doregister.php. Appling md5 encryption to passwords will be no different to what you have now. All you need to do is run the md5() function on whatever variable holds the password. Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541108 Share on other sites More sharing options...
eaglelegend Posted May 14, 2008 Author Share Posted May 14, 2008 Ok this is the original... DoLogin.php <?php session_start(); include("config.php"); $u = $_POST['u']; $p = $_POST['p']; $check = mysql_num_rows(mysql_query("SELECT * FROM `members` WHERE `username`='$u' AND `password`='$p'")); if($check==1) { $_SESSION['Board'] = $u; session_register('Board'); header("Location: main.php"); print"<a href=main.php>Click here</a> to continue."; } else { print "User/Pass mismatch!"; print"<a href=index.php>Click here</a> to continue."; } ?> is this correct?: <?php session_start(); include("config.php"); $u = $_POST['u']; $p = md5($_POST['p']); $check = mysql_num_rows(mysql_query("SELECT * FROM `members` WHERE `username`='$u' AND `password`='$p'")); if($check==1) { $_SESSION['Board'] = $u; session_register('Board'); header("Location: main.php"); print"<a href=main.php>Click here</a> to continue."; } else { print "User/Pass mismatch!"; print"<a href=index.php>Click here</a> to continue."; } ?> Note, this my first official attempt at md5ing something myself heh! Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541161 Share on other sites More sharing options...
MadTechie Posted May 14, 2008 Share Posted May 14, 2008 that will work BUT when you create/update the record you must MD5 it their as well, so your need to check the "new user" function and the "change password" function Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541261 Share on other sites More sharing options...
eaglelegend Posted May 14, 2008 Author Share Posted May 14, 2008 errm, this IS logging in/egerstering with the database online and not for the mobile, anyway they both work, but could you explain more about this other things you are saying? Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541271 Share on other sites More sharing options...
DarkWater Posted May 14, 2008 Share Posted May 14, 2008 The password in the database has to be MD5'd too, in order for the check to work, so you need to MD5 it when you register and put it in the database. Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541273 Share on other sites More sharing options...
eaglelegend Posted May 14, 2008 Author Share Posted May 14, 2008 yep. I have that, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541283 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.