Re: login script with two levels of access



On May 31, 9:31 am, SterLo <sterling.hamil...@xxxxxxxxx> wrote:
Well...

Try this...

It's a little rough but you should get the basic idea.
-------------
<?php
$user1 = "abc";
$user2 = "xyz";
$pass1 = "123";
$pass2 = "456";

$action = (isset($_POST["submit"])) ? $_POST["submit"] :NULL;

if($action == "submit") {
$showForm = false;
$user = $_POST["username"];
$pass = $_POST["password"];
if($user == $user1 && $pass == $pass1) {
/* Include your files here for user1. */
}elseif($user == $user2 && $pass == $pass2) {
/* Include your files here for user2. */
}else{
/* Do error stuff here. */
$showForm = true;
}
}
?>
<?php if($showForm == true) {
<form method="post" action="index.php">
<label for="username">Username:</label>
<input id="username" name="username" type="text" value="" />
<label for="password">Password:</label>
<input id="password" name="password" type="password" value="" />
<input type="submit" name="submit" id="submit" value="Submit" />
</form>
<?php } ?>

Will this not show the user names and passwords in the source code
allowing anyone to pull up the code and get the passwords?

God bless
jason

.



Relevant Pages

  • Re: login script with two levels of access
    ... It's a little rough but you should get the basic idea. ... $showForm = false; ... <?php if{ ... I normally put user id's and passwords in an include file outside the document root. ...
    (comp.lang.php)
  • Re: tools to scan source code
    ... I've been evaluate SWAAT and it is adequately meet my needs. ... I haven't try RATS, but I will try it soon. ... (but it's not dependable it just analyzes source code ... >> PHP is fairly C-like. ...
    (Pen-Test)
  • FW: [PHP] Re: Please hack my app
    ... My name is Jordan Forssman, I am representing a company called Armorize ... We have developed a source code analysis platform for PHP, ... Armorize Technologies ...
    (php.general)
  • Re: Python gets macros - now XML does too
    ... of PHP, which was originally a just simple HTML templating language. ... wanted to open the source of Metastorage in order to attract as many ... that are actual source code of the described classes in meta-programming ...
    (comp.lang.lisp)
  • Re: The Inquirer
    ... >>I could write a compiler for an arbitrary language and put this to open ... > Now go to the url with whatever web browser your using. ... PHP is open source. ... that the actual source code that makes ...
    (comp.os.vms)