Jump to content

login script not logining in.


tomfmason

Recommended Posts

I have fumbling around with this for awhile..lol. I organily was trying to make this alot more complaicted then it needed to be see [url=http://www.phpfreaks.com/forums/index.php/topic,99502.0.html]http://www.phpfreaks.com/forums/index.php/topic,99502.0.html[/url] for more information about my past issues on this subject.

I tried everything that I could think of to hide the login process and came up with nothing, untill now. I had a great idea, why not post to it's self. Well I thought that would work but no. I think I am real close to it working. Here is the script.

[code]<?php
if (isset($_POST['login'])){
  session_start();

  header("Cache-control: private");

  $user = $_POST['username'];
  $pass = $_POST['password'];

  include("db.php");

  $sql_user_check = "SELECT id, access, username FROM users WHERE username='$user' AND password = '".md5($pass)."'";
  $result_name_check = mysql_query($sql_user_check) or die(mysql_error());
  $usersfound = mysql_num_rows($result_name_check) or die(mysql_error());

  if($usersfound < 1){
  $error = "Wrong username/password";
  }
  else {
          $text = mysql_fetch_array($result_name_check);
  $id = $text['id'];
  $access = $text['access'];
          $_SESSION['username'] = $text['username'];
          header('Location: http://www.owpt.biz/account.php?'.SID);
          echo '<html><head><title>Redirecting</title></head>';
          echo '<body><a href="http://www.owpt.biz/account.php?'.SID.'">Continue</a></body></html>';
          exit;
  }
}
$filename = "login.php";
$title = "Login";
$content= "
    <form action=\"test_login.php\" method=\"post\">
      <label>&nbsp;&nbsp&nbsp;&nbsp;login</label>
      <p>
      &nbsp;&nbsp&nbsp;&nbsp<input type=\"text\" name=\"username\" size=\"20\" maxlength=\"15\" value=\"username\">
      </p>
      <p>
      &nbsp;&nbsp&nbsp;&nbsp<input type=\"password\" name=\"password\" size=\"20\" maxlength=\"15\" value=\"password\">
      </p>   
      <p>
      &nbsp;&nbsp&nbsp;&nbsp<input name=\"goButton1\" type=\"submit\" value=\"go\" alt=\"go\">
      </p>
      </form>";
include('includes/main.php'); 
?>[/code]

Any suggestions would be great.
Link to comment
https://forums.phpfreaks.com/topic/13737-login-script-not-logining-in/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.