Jump to content

Search the Community

Showing results for tags 'someone please help'.

  • 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. I have something like this <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="xxxx"; // Database name $tbl_name="xxxxxx"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $username=$_POST['username']; $password=$_POST['password']; // To protect MySQL injection (more detail about MySQL injection) $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $res = mysql_query("SELECT * FROM members WHERE username = '$username' LIMIT 1"); if(mysql_num_rows($res)>0) { $d = mysql_fetch_array($res); if($password == $d['password']) { session_regenerate_id(); //security for changing permissions session_register['id'] = $d['id']; session_register['access_level'] = $d['access_level']; switch($d['access_level']) { case 1: $loc = "home.php"; break; case 2: $loc = "paramedic.php"; break; case 3: $loc = "doctor.php"; break; case 4: $loc = "medprac.php"; break; case 5: $loc = "wardboss.php"; break; case 6: $loc = "consultant.php"; break; } header("Location: $loc"); } } ?> and this is verry correct I suppose. But I am having problem locking the pages. I want doctors and admin to have access to all pages while other to their pages only
×
×
  • 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.