Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SQL query to fetch information of registerd users and finds user match.
- $query = mysql_query("SELECT * FROM company WHERE password='$password' AND username='$username'", $connection);
- $rows = mysql_num_rows($query);
- if ($rows == 1) {
- $_SESSION['login_user'] = $username; // Initializing Session
- $query = mysql_query("SELECT * FROM company WHERE password='$password' AND username='$username' AND permissions = admin" , "$connection")or die(mysql_error());
- echo($query);
- $rows = mysql_num_rows($query);
- if ($rows == 1) {
- $adminedit = "<form>
- <textarea name='editor1' id='editor1' rows='10' cols='80'>
- This is my textarea to be replaced with CKEditor.
- </textarea>
- <script>
- // Replace the <textarea id='editor1'> with a CKEditor
- // instance, using default configuration.
- CKEDITOR.replace('editor1');
- </script>
- </form>";
- } else {
- $adminedit = "<textarea></textarea>";
- }
- header("location: profile.php"); // Redirecting To Other Page
- } else {
- $error = "INVALID USERNAME OR PASSWORD";
- }
- mysql_close($connection); // Closing Connection
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment