Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CheckUsername takes parameter username and password from the user and checks if he is a
- function checkUsername(username, password) {
- if (username == "" && password == "") {
- window.alert("Please enter your Username & Password");
- } else if (username == "") {
- window.alert("Please enter your Username");
- } else if (password == "") {
- window.alert("Please enter your Password");
- } else {
- Ext.Ajax.request({
- url: 'database.php',
- params: {
- functionID: 1,
- uname: username,
- pass: password
- },
- success: function (response, opts) {
- var checked = Ext.util.JSON.decode(response.responseText);
- if(checked == true)
- {
- window.location = "index.html";
- }
- else
- {
- alert("Unsuccessful")
- }
- }
- });
- }
- }
- function showUserName(username)
- {
- var name;
- Ext.Ajax.request({
- url: 'database.php',
- params: {
- functionID: 2,
- uname: username
- },
- success: function (response, opts) {
- name = response.responseText;
- Ext.getCmp('fieldset_index').setTitle("Hello Professor "+name);
- }
- });
- }
Add Comment
Please, Sign In to add comment