Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //cloudapp.azure.com/js/script2.js
- if(error_username == false && error_password == false){
- var details = [$("#username1").val(),$("#password1").val()];
- var url = "http://depressionapp1.westeurope.cloudapp.azure.com/index.php/";
- $.ajax({
- url: url,
- type: 'POST',
- data: {dataname: details},
- success: function(result){
- //THIS IS WHERE I AM HAVING PROBLEMS
- location.href = "http://depressionapp1.westeurope.cloudapp.azure.com/welcome1.html";
- /* or
- var url1 = "http://depressionapp1.westeurope.cloudapp.azure.com/" + result;
- $.get(url1);*/
- }
- });
- //UserController@postLogin works fine and returns 'welcome.html'
- public function postLogin(Request $request){
- $result = DB::table('users')->select('user_id')->where('username', $request['username'])->get();
- $user = $result[0];
- $val = '';
- if(Auth::attempt(['username' => $request['username'], 'password' => $request['password']])){
- $count = Answer::where('user_id', $user->user_id)->where('level', '<>', NULL)->count();
- if($count){
- return redirect()->route('checkLevel');
- }else{
- $val = 'welcome1.html';
- }
- }
- $data = array('page' => $val, 'id' => $user->user_id);
- return response($val);
- I have shown the two attempts
- $.ajax({
- url: url,
- type: 'POST',
- data: {dataname: details},
- success: function(result){
- //THIS IS WHERE I AM HAVING PROBLEMS
- location.href = "http://depressionapp1.westeurope.cloudapp.azure.com/welcome1.html";
- /* or
- var url1 = "http://depressionapp1.westeurope.cloudapp.azure.com/" + result;
- $.get(url1);*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement