[PHP] Login Tutorial / No Mysql / DarkCoder
My First tutorial on My New Series Of Php Tutorials.
http://www.youtube.com/watch?v=pbg4rfvW4WI
Discription:
Code:
Code: http://elitetactics.sytes.net/codes/index.php
Please rate and subscribe for more.
We would love it!
This is a php tutorial for people tpo login to a certain file or show a certain text.
%Tutorial
%PHP
%Html
Please Subscribe :)
Re: [RELEASE] PHP Login Tutorial / No Mysql / DarkCoder
very basic. should move to showcase
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
Hmm...very useful for beginners like me in PHP. I actually learnt a lot from this, thanks!
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
Pretty basic, also if you're passing stuff like passwords through a form, NEVER use get it's very unsafe. Use post instead.
Also, you're coding style is sloppy, it'll make your brain explode on big projects.
This is how I would code it:
PHP Code:
<form name='password' action="test1.php?" method="post">
Password: <input type="text" name="pass"><br />
<input type="submit" value="Go!">
<br /> </form>
<?php
$pass=$_POST['pass'];
if ($pass == "dark") {
echo "Password Correct.";
}
?>
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
/page.php?pass=thisismypweveryonecankindaread
tis s mush betta, not like you need md5 when you're not saving it anywhere though.
PHP Code:
$pass = md5(ahoj);
$post = md5($_POST['pass']);
if($pass == $post)
{
echo "ok";
}
else
{
echo "wrong password, you fail";
}
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
Foxx123, what does "ahoj" equal?
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
it's czech hello .. hm and when I think about it, $pass = md5("ahoj");
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
Ahoj Foxx :)
Also, there are better ways of doing this, sessions etc. but good to learn the basics.
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
Quote:
Originally Posted by
Foxx123
/page.php?pass=thisismypweveryonecankindaread
tis s mush betta, not like you need md5 when you're not saving it anywhere though.
PHP Code:
$pass = md5(ahoj);
$post = md5($_POST['pass']);
if($pass == $post)
{
echo "ok";
}
else
{
echo "wrong password, you fail";
}
OK... but what's the
PHP Code:
$pass = md5(ahoj);
there for?
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
That's the password, md5() is a php function which makes it encoded.
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
But it says the password is 'pass'?
Re: [PHP] Login Tutorial / No Mysql / DarkCoder
nope, it says that the password is "ahoj",
in that guide he did
PHP Code:
if ($pass == "dark") {
where "dark" is the password, i've only "stored" that password in a variable..
in his guide it would be
PHP Code:
$password = "dark";
if ($pass == $password) {
Re: [PHP] Login Tutorial / No Mysql / DarkCoder