Search Posts

Category: php

How to compress image size before uploading using php

I already searched lots of stuff, some of them are from stackoverflow. But none of them helped me. What I want to do is reduce the image file size, and after reducing the image will now be uploaded. Here’s my current code: <?php include ‘cloud_functions.php’; // GET THE USER’S ID $userid = _clean($con, $_POST[‘userid’]); if(!is_dir(“uploads/user/”.$userid.”/”)){ mkdir(“uploads/user/”.$userid.”/”, 0755); } $temp = explode(“.”, _clean($con,$_FILES[“file”][“name”])); $targetPath = “uploads/user/”.$userid.”/”; // RENAME THE IMAGE USING ROUND(); $newFN = round(microtime(true)) . […]

angular .htaccess 404 for html5mode

I am trying to make my urls looks like localhost/CLCAppV2/client/register rather than looking like ocalhost/CLCAppV2/client/index.html#/register So I configured my .htaccess like <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.html/$1 </IfModule> I then configured my angular config to look like $urlMatcherFactoryProvider.caseInsensitive(true); $locationProvider.hashPrefix(”); $urlRouterProvider.otherwise(‘/register’); $locationProvider.html5Mode({ enabled: true, requireBase: true }); I also have my html base url set in the index.html as <base href=”/CLCAppV2/client/”> My current folder structure looks like […]

angularjs multilevel menu didnt work with databse

i created multilevel menu in angularjs with ng-repeat using hardcode its work properly, but whene i change hardcode to database the dropdown doesnt collapse its my controller.js function menuCtrl($scope,$http) { $scope.userName =’Andri’; $scope.menus; $scope.getMenu = function(){ $http({ method : ‘GET’, url : ‘menu.php’ }).then(function(response){ //success $scope.menus =; },function(response){ //error console.log(, response.status); }); }; $scope.getMenu(); // its my hard code // $scope.menus = [ //this data willbe taken by encoded php file // {“id” : […]

CodeIgniter 3 Implement Promise

My CI app makes API call to third party Rest API server which will be consumed by front end. At first, front end app will hit my CI app and which in turn will hit third party LogInAPI(session valid for 15 mins), and after login we need to hit subsequent API calls by passing the key(response of loginApi) in header. So basically I need to hit loginAPI for every 15 minutes. I am trying angular […]

Update Angular JS1 UI when a row is updated in mysql with php on the backend

I want to update the User interface with HTML/AngularJS-1x and Php/mysql on the backend. The staging table is populated by another cpp process, I looking for ways to update the UI when that staging table is populated. I am fine with creating API or waiting using Angular Promises. But how do we proceed. One idea could be : create an get_items api which counts the staging table rows and return if the rows are there.On […]

How to replace some character with space in AngularJs

I need to replace all special character with hyphen(-) with this name like (Inka -Tiitto-s-Camp-Aero-Gravity-Milan-9). But I am getting this error. => The URI you submitted has disallowed characters. and also getting the name like this (Inka Tiitto’s Camp @ Aero Gravity Milan -9) I have tried this line of code but not getting desirable result. <a href=”<?= BASEURL ?>camp/{{‘/[.,-/#!$%^&*;:{}=-_`~()@+?><[]+]/g’).join(‘-‘)}}-{{}}”>{{}}</a> Could anyone help me to get this. Any help will be appreciated. Thanks in advance […]

need to fetch from database to this dropdown : AngularJS and PHP

Currently i have hardcoded the components in Dropdown . I need to remove hardcoded values in ‘ $scope.categoryTypes ‘ and fetch a column of table in DataBase using php angular code for dropdown is as follows <script type=”text/javascript”> (function() { ‘use strict’; angular .module(‘myApp’, []) .controller(‘testCtrl’, testCtrl); testCtrl.$inject = [‘$scope’]; function testCtrl($scope) { $scope.categoryTypes = [‘M-Trouser-Denim ‘,’M-Trouser-Cotton’]; $scope.clothCount = [‘1′,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9′,’10’] $scope.itemSet = { item: [] }; $scope.addNewItem = function() { $scope.itemSet.item.push({}); }; $scope.removeItem = function(index) […]

Angular and symfony in one dir – htaccess

I have following problem, I have in folder /var/www/html 2 dirs: app (angular application) and api(restful api and cms written in symfony3). In both directories there is appropriate htaccess for each application. The document root is /var/www/html and I need the website to be redirected to app/index.html, and only /api/ to api subfolder. But I can’t get this working with symfony htaccess. Angular htaccess is default provided. Symfony htaccess: DirectoryIndex app.php <IfModule mod_rewrite.c> RewriteEngine On […]