Re: [No mysql]login script
Yes it works... But in-terms of security, I don't think that'll last.
Re: [No mysql]login script
Re: [No mysql]login script
thanks yoni for great number.
Re: [No mysql]login script
Very nice. Brilliant script for logging in. I can't find my C++ program. Keeping it neat I see. Oh well, I will be of to look for a new C++ program. Fuck that.
_Hacker
Re: [No mysql]login script
thanks you Hacker for sweet command
Re: [No mysql]login script
So where would all the name's and password's be stored?.
--
So you are only able to use one name and one password?
Re: [No mysql]login script
can more but you have to edit the code
just add under
PHP Code:
if($_POST['id'] == 'test' AND $_POST['pw'] == '1234'){
echo "welcome ";
echo $_POST['id'];
}
under the }
you place
PHP Code:
elseif($_POST['id'] == 'username2' AND $_POST['pw'] == 'password2'){
echo "welcome ";
echo $_POST['id'];
}
Re: [No mysql]login script
So people wont be able to register, they will just have to use pre-givin username and password?.
Re: [No mysql]login script
lmmfao
I would expect nothing more
You have no idea how insecure that is =D
I would be embarrassed to ask for a rating on this script
Re: [No mysql]login script
@Wh005h, Lol love your comment.
It would have to be insecure if it was HTML and had pre-arranged username and password's unless... umm... I dunno, would anyone bother using it?
Re: [No mysql]login script
I wouldnt ^^, if I need users to login it will be large ammounts and thus I would use a db. OR I use it for admin access only and than I would use the build-in authentication of browsers. Its not really a showcase, but whatever ^^
And I agree with Wh005h :)
Re: [No mysql]login script
Here's some good suggestions so I can turn this into something productive hopefully lol
1. Hash the password and compare hashes
2. For account registration, have it write to a txt file and reference an exploded txt string to find logins
3. Get, learn to use, and/or just use a database, it's not hard... If it was a mssql database I might could understand.
Re: [No mysql]login script
Yeah basically someone could just view source and get username and password or if you encrypt they can decrypt, simple as pie.
Re: [No mysql]login script
its easy with database but i specially choose without database coz not everyone have that option if you get free database than its mostly slow ...
this system is used for private not for everybody to register.
Re: [No mysql]login script
Quote:
Originally Posted by
passie
i maked a basic login script PHP/HTML
no mysql requested
rate it please
sample :
Untitled Document (delete if not allowed).
id:test
pw:1234
Code:
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="login.php">
<label>
Username
<input type="text" name="id" id="id" />
</label>
<p>
Password
<input type="password" name="pw" id="pw" />
</p>
<p>
<label>
<input type="submit" name="button" id="button" value="Login" />
</label>
</p>
</form>
</body>
</html>
PHP Code:
<?php
if($_POST['id'] == 'test' AND $_POST['pw'] == '1234'){
echo "welcome ";
echo $_POST['id'];
}
elseif(empty($_POST['id']))
{
echo "You left username field empty, Go back.";
}
elseif(empty($_POST['pw']))
{
echo "You left password field empty, Go back.";
}
else
{
echo "You dont have right to login";
}
?>
PHP Code:
echo "You left username field empty, Go back.";
exit()
}
Otherwise you get the page that you wanted to protect
Re: [No mysql]login script
oh yea ty superfun i did forget that !
Re: [No mysql]login script
normally you'll use a MySQL or MSSQL database with information to get the PW and the Username..
password MD5 encrypted ofc for better secured passwords
Re: [No mysql]login script
Lol, you always post doubleposts ^^
I hope you're not posting it here in the showcase forum too, because than the forum gets sort of bad reputation (now it has lots of advertisements already). Reply it here :P
Re: [No mysql]login script
Quote:
Originally Posted by
Daevius
Lol, you always post doubleposts ^^
I hope you're not posting it here in the showcase forum too, because than the forum gets sort of bad reputation (now it has lots of advertisements already). Reply it here :P
Okey i post it here.
There we go all know im finnish guy so i have typed this script in finnish language but i have transilaited it.
Info:
Just make users.txt and chmode it and whooo!
[PHP]<?php
session_start();
$userfilu = "users.txt"; // Where go all user.
$tunmin = "3";// Username min letters require
$pasmin = "3"; // password min letters require
if($_GET['act'] == "login"){
$u = $_POST['tunnus'];
$f = file("$userfilu");
for($a=0;$a<count($f);$a++){
$t = explode("|",$f[$a]);
if($u == $t[0]){
if($_POST['tunnus'] == $t[0]){
if($t[1] == sha1($_POST['salasana'])){
session_register("tun");
$_SESSION['tun'] = $_POST['tunnus'];
session_register("iposo");
$_SESSION['ipodo']= $_SERVER['REMOTE_ADDR'];
echo'Login<br><br>
<a href="'.$_SERVER['PHP_SELF'].'">Home</a><br><br>';
}
}
}
}
}
if($_GET['act'] == "logout"){
session_start();
session_unregister("tun");
session_unregister("iposo");
echo'You logged out<br><br>
<a href="'.$_SERVER['PHP_SELF'].'">Home</a><br><br>';
}
if($_GET['act'] == "rek"){
echo'<form method="post" action="'.$_SERVER['PHP_SELF'].'?act=send">
Username<br>
<input type="text" name="tunnari"><br>
password<br>
<input type="text" name="passu"><br>
password again<br>
<input type="password" name="passu2"><br><br>
<input type="submit" value="Register"><br><br>
</form>';
}
if($_GET['act'] == "send"){
if(!trim($_POST['tunnari']) or !trim($_POST['passu']) or !trim($_POST['passu2'])){
exit('You must fill all forms');
}
if($_POST['passu'] == $_POST['passu2']){
$tu = array();
$fi = file("$userfilu");
for($e=0;$e<count($fi);$e++){
$tt = explode("|",$fi[$e]);
$tu[$e] = $tt[0];
}
if(!in_array($_POST['tunnari'],$tu)){
if(strlen($_POST['tunnari'])< $tunmin) exit('Username is too short');
if(strlen($_POST['passu'])< $pasmin) exit('Password is too short');
$tunnari = $_POST['tunnari'];
$passu = sha1($_POST['passu']);
$tunnari = htmlspecialchars($tunnari);
$tunnari = stripslashes($tunnari);
$passu = htmlspecialchars($passu);
$passu = stripslashes($passu);
$f = fopen("$userfilu","a");
flock($f,2);
fwrite($f,"$tunnari|$passu|\n");
flock($f,3);
fclose($f);
echo'Registeration is complited!<br><br>
<a href="'.$_SERVER['PHP_SELF'].'">Login</a><br><br>';
} else {
exit('Username is already taked :(');
}
}else {
exit('Wrong username or password.');
}
}
if(empty($_SESSION['tun']) and empty($_SESSION['iposo'])){
echo'<form method="post" action="'.$_SERVER['PHP_SELF'].'?act=login">
Username<br>
<input type="text" name="tunnus"><br>
password<br>
<input type="password" name="salasana"><br><br>
<input type="submit" value="Login">
</form>
<a href="'.$_SERVER['PHP_SELF'].'?act=rek">Rekister
Re: [No mysql]login script
maybe you make better but i only did learn serieus for 1 week ^^
and a bit jealous :$
Re: [No mysql]login script
Re: [No mysql]login script
your welcome Hurricane if you need more help just pm me !
Re: [No mysql]login script
hhhmm i actually like it
not the securist thing going but does the job if you just want to add a simple login page to a pictures page or something
ty :)
Re: [No mysql]login script
lol i wrote a better script than that. it dosent use Sql nor Xml it stores it in a file called 3x4.txt and it hashes all the passwords. in Md5
ill post it in a minute.