Jump to content

Search the Community

Showing results for tags 'php log in'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, Guys Im new here im creating our system for Thesis , so our system is MIS ( Management Information System) it have subsystem of Employee Management System , Assests Management System, Customer Relation Management. So when im creating log in i encounter this problems. Im thinking that problem is came from core.php but i dont know how to fix it. Here is my indes.php This is my core.php <?php ob_start(); session_start(); $current_file = $_SERVER['SCRIPT_NAME']; function loggedin() { if (isset($_SESSION['user_id'])&&!empty($_SESSION['user_id'])) { return true; } else { return false; } } function adminloggedin() { if (isset($_SESSION['user_id'])&&!empty($_SESSION['user_id'])) { return true; } else { return false; } } ?> this is my loginform. <?php if (isset($_POST['eusername'])&&isset($_POST['epassword'])) { $username = mysql_real_escape_string($_POST['eusername']); $password = mysql_real_escape_string(md5($_POST['epassword'])); if (!empty($username)&&!empty($password)) { $query = "SELECT * FROM tbl_account WHERE LogUsername='".$username."' AND LogPassword = '".$password."' AND type = 'ADMINISTRATION' "; if ($query_run = mysql_query($query)) { $query_num_rows = mysql_num_rows($query_run); if ($query_num_rows==0) { echo 'Invalid username/Password combination.'; } else if ($query_num_rows == 1) { $user_id = mysql_result($query_run, 0, 'LogUsername'); $_SESSION['user_id']=$user_id; $_SESSION['type'] = "EMPLOYEE"; header('Location:../MIS1/indes.php'); } } } else { echo 'You must supply username/password.'; } } ?> <div id="employee"> <form action="<?php echo $current_file ?>" method="POST"> Employee ID: <input type="text" name="eusername"> </br> Password: <input type="password" name="epassword"> <input type="submit" id="employeesubmit" value="Log in"> </form> </div> <div id="admin"> <form action="<?php echo $current_file ?>" method="POST"> Admin ID: <input type="text" name="username"> </br> Password: <input type="password" name="password"> <input type="submit" id="adminsubmit" value="Log in"> </form> </div> this is my adminloginform.php <?php if (isset($_POST['username'])&&isset($_POST['password'])) { $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string(md5($_POST['password'])); if (!empty($username)&&!empty($password)) { $query = "SELECT * FROM tbl_account WHERE LogUsername='".$username."' AND LogPassword = '".$password."' AND type = 'ADMINISTRATION' "; if ($query_run = mysql_query($query)) { $query_num_rows = mysql_num_rows($query_run); if ($query_num_rows==0) { echo 'Invalid username/Password combination.'; } else if ($query_num_rows == 1) { $user_id = mysql_result($query_run, 0, 'LogUsername'); $_SESSION['user_id']=$user_id; $_SESSION['type'] = "ADMININSTRATION"; } } } else { echo 'You must supply username/password.'; } } ?> This is my connect.php <?php $conn_err ='Cant Connect'; $mysql_host = 'localhost'; $mysql_user = 'root'; $mysql_pass = ''; $mysql_db = 'mis'; if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass)||!@mysql_select_db($mysql_db)) { die($conn_err); } ?> Please help me i need to it to continue my thesis i also attach the php files for who wants to try
×
×
  • 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.