Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541108
Share on other sites

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!

Link to comment
https://forums.phpfreaks.com/topic/105588-solved-mobile-md5/#findComment-541161
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.