Search Posts

Category: php

AJAX issue with Apache .htaccess file

how to AJAX issue with Apache .htaccess file I have removed the hashbang from the URL with the below code. But for an AJAX it is loading the index.html. How can I fix? I have added <base href=”/”> in index.html and $locationProvider.html5Mode(true); in AngularJS controller. Here’s my .htaccess file RewriteEngine On # If an existing asset or directory is requested go to it as it is RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ […]

I am using ionic and getting an error: SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>)

how to I am using ionic and getting an error: SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) This is my Code: this.http.get(‘http://localhost/….) .map((res) => res.json()) .subscribe(( this.navCtrl.push(OtpPage,{mobileno:this.mobile}); }, (err) => { console.log(err); }); and getting the following error: SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse () Anyone can help Please?? Source: AngularJS

employee registration form including file upload [on hold]

I have a problem regarding “employee form registration” in AngularJS. I have done successful to send the values for name, address,phone,email..etc into MySQL by using PHP and AngularJS. But now coming to the point including the FILE type field (img.jpeg)was not inserting to the MySQL (database) I need a brief code for regarding Question: how to send the file upload field using AngualrJS along with all fields?(using PHP, JS, MySQL) Source: AngularJS

Can someone explain about this code?

I just recently found the code on a website. In a login form to encrypt the password to be sent to the server via the browser.I want to re-create the code in the php version but this code is difficult to understand because it uses the framework Angular JS. Which I do not know at all. can someone help me how this code works? thank you for your help function encryptData(a) { if (keys = […]

Response code 200 instead of 500 laravel with angular js

I am facing issue with my project where i am calling API from Angularjs front end to laravel backend api. In my authenticationcontroller.php in authenticate method i am returning return response()->json([‘error’ => ‘Oops! you are not allowed to log in’], 500); using this route in web.php Route::post(‘authenticate’, ‘[email protected]’); when i return this i got response code 200 instead of 500 and response as string instead of json Now when i directly return json from web.php […]

Use same function for different inputs

I have an input field and autocomplete list: <input type=’text’ ng-keyup=’fetchUsers()’ ng-model=’name’> <ul id=’searchResult’ > <li ng-click=’setValue($index)’ ng-repeat=”result in searchResult”>{{ result.username }}</li> </ul><br> <button type=”button” ng-click=”addNew()”>Add Member</button> Here is autocomplete function: // Fetch data $scope.fetchUsers = function(){ $http({ method: ‘post’, url: ‘Unity/autocomplete.php’, data: {name:$scope.name} }).then(function successCallback(response) { $scope.searchResult = response.data; console.log(response.data); }); } // Set value to search box $scope.setValue = function(index){ $scope.name = $scope.searchResult[index].username; $scope.house = $scope.searchResult[index].hname; $scope.searchResult = {}; } And there is […]

How can we use pagination with angularjs without bootstrap style

I use Angularjs with pagination but i don’t want Boostrap style for my pagination templte how can? I try to edit these function in dirPagination.js in angularjs with my template pagination but it’s seem to be not working anyone have some example for use pagination with angularjs but no need bootstrap style. function dirPaginationControlsTemplateInstaller($templateCache) { $templateCache.put(‘angularUtils.directives.dirPagination.template’, ‘<div class=”col-md-12″><ul class=”pagination”><li ng-if=”boundaryLinks” ng-class=”{page-item disabled : pagination.current == 1 }”></li><li ng-if=”directionLinks” ng-class=”{page-item disabled : pagination.current == 1 }”><a […]

Web applications not working properly when hosted to server, works locally. Web pages not rendered too

I created an application using PHP ,AngularJS for front end and NodeJS for back end (Rest API). It has 2 portals for admins and students. When I hosted the application in a Ubuntu server and tested it. This is the output i’m getting from Firefox. It shows me login page and then i have a middle ware of auth.php. Page stops there. I will show you my auth.php file. <?php session_start(); $id = $_POST[‘id’]; $status […]

Next Page »