Skip to main content

Posts

Showing posts with the label php

Working with HTML5 Date and Number Inputs in Angularjs with MySQL and PHP

Angularjs provide an directive for the Date and Number input elements. We may be in a problem while handling the form having these as input from the user. There is always a type miss match between the value provided or accepted by these input and and the value accepted by the MySQL database. In Angular, we send and receive data in a JSON format to prevent the page reload. JSON are provided into a string form, we need to process the JSON string at client side. Date , Integer and Float values are provided into string format so, we need to process the these values. To show how to tackle this type mismatch, I have created an simple app that take one text, one float, one integer and one date value from the user and send it to server for storing into the database and return the inserted data item back to the user into JSON format. Before going into the app, it should be noted that. HTML5 date input takes and provide Date object HTML5 number input takes number ...

3 Ways to use angular $http service with php processing

Angular $http service is used to send asynchronous http request to the server. To learn how to use $http service with php, we will create a simple app using form directive. This app will take two numbers and send the these number to php server for their sum. Here we will use php code to process the data and return the sum. Let's jump into the app. Here is front end HTML code for our app. We are using twitter bootstrap to for awesome look of our app: Way 1: HTML Code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Find Sum</title> <link rel="stylesheet" href="css/bootstrap.min.css"> </head> <body ng-app="myApp"> <div class="container" ng-controller="myAppCtrl"> <div class="row"...