Category : php

Working on updating a project that was written years ago. on the login once i click on login the form just refreshes no errors. function AuthController($scope, $http) { $scope.SignIn = function() { var f1=$(‘#username’).val(); var f2=$(‘#password’).val(); if(f1!=” && f2!=”){ $http({ method: "POST", url: "<?php echo base_url (); ?>login/authenticate", data :JSON.stringify({uname: $scope.username, pswd: $scope.password}), headers: {‘Content-Type’: ..

Read more

I create a Angular 10 app with rest api in Php. I host my api on live serve url is as "https://bpegm.co/quiz/leaderboard/create.php" . Whenever I Press Submit button I will get error like this Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://bpegm.co/quiz/leaderboard/create.php. (Reason: CORS preflight response did not succeed). ..

Read more

I have some problems with Angular. I’m using Angular to send the DELETE and PUT method to the RESTful server, it does not work but I can use the GET and POST Method I’ve already used the header("Access-Control-Allow-Origin: *"); in my RESTful PHP file. When I send the Delete Method to the RESTful server, it ..

Read more

I have a legacy angular.js app that uses a PHP backend. If there is a bug in the PHP code, angular.js spews an unhelpful error like this: angular.js:14199 SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at fromJson (angular.js:1345) at defaultHttpResponseTransform (angular.js:10878) at angular.js:10969 at forEach (angular.js:325) at transformData (angular.js:10968) at ..

Read more

I’m building APIs for a frontend application that requires login. I’m able to do the authentication alright. but I want to do it in a more enhanced way where if the username and password are wrong, I’d put it in an error class. C $data= json_decode(file_get_contents("php://input")); $userName= ($data->userName); $userName= ($data->passWord); $errorMsg=array("message"=>("wrong username or password")); $row ..

Read more