Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ...
- ...
- if ( $username && $password )
- {
- $data['response'] = 'valid';
- else
- {
- $data['response'] = 'invalid';
- }
- echo json_encode($response);
- $.ajax({
- type: 'POST',
- url: 'url',
- data: {username : username, password: password},
- success: function(response){
- if(response.response === valid){
- window.location.replace('admin-page');
- }else{
- //error
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement