Jump to content


Photo

simple php password


  • Please log in to reply
2 replies to this topic

#1 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 25 July 2006 - 02:38 PM

hi,
can somebody tell me, where can I find simple php password tutorial? Here is my effort, but I don't want the user to see the redirect...

<?php
$user = $_POST["user"];
$pass = $_POST["pass"];
$linkW = "http://www.3d.caucas...sus.net/admin";
$linkShowW = "Your Username or Password is incorrect";
$linkR = "http://www.3d.caucas...min/admin.php";
$linkShowR = "Welcome Online Aid";
$id = "gio"; //username
$paroli = "gio"; //password
if($user==$id)
if($pass==$paroli)
  echo "<a href='".$linkR."'>".$linkShowR;
else
  echo "<a href='".$linkW."'>".$linkShowW;
?>

thanks
I don't need your script, I'll try to write it myself

#2 CheesierAngel

CheesierAngel
  • Members
  • PipPipPip
  • Advanced Member
  • 105 posts
  • LocationBelgium

Posted 25 July 2006 - 02:45 PM

It would be more secure if you would use a database to store your passwords in.

$id = "gio";
$paroli = "gio";

isn't secure to store like this in your code.

You can use the function header() for this.

<?php
$user = $_POST["user"];
$pass = $_POST["pass"];
$linkW = "http://www.3d.caucasus.net/admin";
$linkShowW = "Your Username or Password is incorrect";
$linkR = "http://www.3d.caucasus.net/admin/admin.php";
$linkShowR = "Welcome Online Aid";
$id = "gio"; //username
$paroli = "gio"; //password
if($user==$id && $pass==$paroli)
  header("Location: $linkR");
else
 header("Location: $linkW");
?>


#3 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 25 July 2006 - 02:49 PM

ok, I'll try:) thanks
I don't need your script, I'll try to write it myself




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users