Guest User

Untitled

a guest
Jan 10th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.38 KB | None | 0 0
  1.  
  2. // SQL query to fetch information of registerd users and finds user match.
  3.         $query = mysql_query("SELECT * FROM company WHERE password='$password' AND username='$username'", $connection);
  4.         $rows = mysql_num_rows($query);
  5.         if ($rows == 1) {
  6.             $_SESSION['login_user'] = $username; // Initializing Session
  7.             $query = mysql_query("SELECT * FROM company WHERE password='$password' AND username='$username' AND permissions = admin"  , "$connection")or die(mysql_error());
  8.             echo($query);
  9.             $rows = mysql_num_rows($query);
  10.             if ($rows == 1) {
  11.                 $adminedit = "<form>
  12.                <textarea name='editor1' id='editor1' rows='10' cols='80'>
  13.                This is my textarea to be replaced with CKEditor.
  14.                </textarea>
  15.                <script>
  16.                    // Replace the <textarea id='editor1'> with a CKEditor
  17.                    // instance, using default configuration.
  18.                    CKEDITOR.replace('editor1');
  19.                </script>
  20.            </form>";
  21.             } else {
  22.                 $adminedit = "<textarea></textarea>";
  23.             }
  24.             header("location: profile.php"); // Redirecting To Other Page
  25.         } else {
  26.             $error = "INVALID USERNAME OR PASSWORD";
  27.         }
  28.  
  29.         mysql_close($connection); // Closing Connection
  30.     }
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment