oh no! how can ask guest to register in my site---->>

A

Anonymous

Guest
Hello Mr. Pejone and all of members

Can you advice me how to:-

1. Asking guest to register->become a member of site. For example this forum
2. using Mysql to store database:USERNAME and PASSWORD. only username registered can access relevant data (i.e portal)
-different user , different data. With my experience i use this code to ASKING user to input USERNAME and PASSWORD and then SUBMIT -process with another file
1. passwordLecturer.php---> for asking user to input username & password
Code:
<? php
include("header1.php");
	print("You're using ");
	print($HTTP_USER_AGENT);
	print(" to see this page.<BR>\n");
 print("please enter your PASSWORD");
?>

<form method="POST" action="kataLecturer.php">
<div align="left"><p><font face="BankGothic Md BT">
Admin name?</font>
   <input type="text" name="name" size="14">
Admin password?</font>
<input type="password" name="pw1" size="15"><br><input type="submit" value="submit"></p>

</div></form>

and then this is
2.kataLecturer.php---> to process username and password

Code:
<?php

$adminname="azman";
$adminpass = "1234";
if ($pw1 == $adminpass)
if($name ==$adminname)
{
//   print("WELCOME TO ADMINISTRATION PAGE");
   echo("<BR>");

include("lecturerpages.php");


}


  else
{
   print("Wrong password");
}
?>

If i want to add another password i have a problem. I need that username & password can be stored in Mysql and then using PHP , i can retreive.
--------------------------------------
Thanks. Happy New Year for happy live

SELAMAT TAHUN BARU 2003
 
If you want to, we can tell you how to do it :D
but there are many resources on the net that you can download and see how they work.
Your method is okay, the only thing is that you have to implement mysql queries.
And one little thing -->
Code:
if ($HTTP_POST_VARS["pw1"] == $adminpass and $HTTP_POST_VARS["name"] ==$adminname) {
......
}

I suggest using md5 encription to manage passwords. You can send them from the browser using javascript md5 and then check them using the md5 php function (which is already implemented) from the server.

javascript md5 --> http://pajhome.org.uk/crypt/md5/

If you have further problems, just ask
bye!
 
thanks for your advice.

I've been visited your website. it's very interesting. I'm Masters Degree student in IT and also taking :Information Security subject in my study.

how to use that md5 jscript according to php or ?. i don't understand.
*---------------------------
simple Malay Language
Greeting:
Good Morning : SELAMAT PAGI
selamat- "good condition, situation, free"
pagi - "morning - 7.00 a.m and above untill
12.00 p.m (noon)
 
Well, I would use the javascript md5 encyption system to send the password from the browser's visitor and then I would keep it in the database as is.
This a good way to ensure a minimum of security.
Then just use it any time the visitor logs in to compare with the one kept in the database.

Using the php md5 function is not as secure as sending it from the very browser (php is a server side language), because you are sending private information through the net and then converting it into hexadecimal value.
The best way is doing it from home :D

An example:

the javascript:
Code:
function encript_validate(){
	if(document.forms[0].elements[0].value!="" && document.forms[0].elements[1].value!=""){//this two are the login and password textfields
		md5_enc = hex_md5(document.forms[0].elements[1].value);//let's encript the password befor sending it
		document.forms[0].elements[1].value = md5_enc;//let's change the password textfield value with the new encripted value
		return true;
		//alert(document.forms[0].elements[1].value);//uncomment it to see how it works
	}else{
		alert("Fill all fields, please!");
		return false;		
	}
}

the form:
Code:
<form action="<?php $php_self ?>" onsubmit="return encript_validate()" method="POST">
l o g i n <br>
<input type="text" name="user"><br>
p a s s w o r d <br>
<input type="password" name="hex_pass"><p>
<input type="submit" name="send_it" value="Send it!">
</form>

This is how I didi it.
I hope you'll find it useful
:)
 
Back
Top