Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
How to Use AJAX in PHP and jQuery
Jan 07, 2019 @ 17:40:40

The TutsPlus.com site has a new tutorial posted showing you how you can use PHP, jQuery and AJAX together to help make the overall user experience of your application better and more responsive.

Today, we’re going to explore the concept of AJAX with PHP. The AJAX technique helps you to improve your application's user interface and enhance the overall end user experience.

The post starts with an introduction to AJAX - what it is, how it's commonly used and how the normal requests flow. They then show how it works with normal "vanilla" Javascript (no jQuery) and how that compares to the jQuery version. It then dives into the real-world example script, showing how to create a form that sends login information to the backend for evaluation via a POST request.

tagged: ajax tutorial jquery login form introduction

Link: https://code.tutsplus.com/tutorials/how-to-use-ajax-in-php-and-jquery--cms-32494

SitePoint PHP Blog:
Calendar as a Service in PHP? Easy, with Google Calendar API!
Jan 26, 2017 @ 16:25:21

On the SitePoint PHP blog there's a new tutorial posted by Wern Ancheta showing you how to offer "calendar as a service" in your application with the help of the Google Calendar API. The Calendar API provides access to all of the features you'd expect from the Google Calendar system and the tutorial helps you make a fully functional overlay integrated with it and living in your application.

In this article, you’ll learn how to work with the Google Calendar API in PHP. You’ll do it by building a calendar app that allows users to add new calendars, add events, and sync calendars to Google Calendar.

The tutorial then walks you through every step of the process you'll need to get your application hooked into the API and the code to use for the integration:

  • Setting up a Google Console Project
  • Building the App
  • Configuring the App
  • Creating a Service Container for the Google Client
  • (Adding) Routes
  • Admin Route Middleware
  • Database setup
  • Home Pages creation
  • Admin Pages creation
  • Creating a Calendar
  • Creating an Event
  • Syncing a Calendar
  • Listing Events
  • Logging Out

The application they create is Laravel based and makes use of a bit of Javascript in the views for the date selector and handlebars templating.

tagged: calendar api google service tutorial laravel jquery

Link: https://www.sitepoint.com/calendar-as-a-service-in-php-easy-with-google-calendar-api/

SitePoint PHP Blog:
Pagination with jQuery, AJAX and PHP
May 28, 2015 @ 14:46:57

The SitePoint PHP blog has a new tutorial posted showing you how to set up pagination with jQuery and PHP using a simple Silex-based application.

n this article, we’re going to explain how easy it is to paginate your data set using PHP and AJAX via jQuery. We’re also going to use the Silex framework for simplicity.

The data he's going to paginate through is a list of "people" data with ID, name and age values. He starts by helping you get Silex installed and a new project created. With that in place, he shows how to inject the database connection (PDO) into the application and set up the simple route to output the "people" data back to the waiting Javascript. The route includes a page number value that's used in the LIMIT statement to segment the results into pages. He also includes another route that returns a total count of people records so the pagination knows when to end. With the backend in place, he then moves to the frontend, showing the complete code to get the page records and populate them into the page (via a list).

tagged: pagination tutorial ajax jquery silex people data

Link: http://www.sitepoint.com/pagination-jquery-ajax-php/

SitePoint PHP Blog:
Social Network Style Posting with PHP, MongoDB and jQuery - part 2
Nov 19, 2013 @ 19:55:17

The SitePoint PHP blog has posted the second part of their series about the creation of a simple comment posting social site based on PHP, MongoDB and jQuery. In this second part they build on the structure from part one and add in posting and "liking".

In the previous part of the series, we explained the database architecture, post stream design and application flow required for developing our post mechanism wherein the user will be able to post a status, like/unlike other people's statuses and comment on them. This part of the series will drive you through the coding required to implement these functionalities. We will use the application flow and database structure as discussed in the last article. Don't forget to download the code from the github repo if you'd like to follow along.

First he shows you how to get new posts added to the database, POSTed to the backend PHP script. He also shows how to insert the contents back into the page and pull out the latest posts. Next up is the like/unlike-ing of the posts, handled by a simple submission to another backend script.

tagged: tutorial mongodb social post jquery

Link: http://www.sitepoint.com/social-network-style-posting-php-mongodb-jquery-part-2/

SitePoint PHP Blog:
Social Network Style Posting with PHP, MongoDB and jQuery - part 1
Nov 15, 2013 @ 15:09:43

The SitePoint PHP blog has a new tutorial posted today kicking off a series about creating a "social network style posting" application that combines PHP, MongoDB and jQuery that feels similar to a nested commenting system you'd see on most social sites.

Post mechanisms similar to Facebook are nowadays very common within any application. The concept of Post-Like-Comment is familiar to everyone who ever used a social network. In this article, we will learn how to create a similar working model wherein the user will be able to post his status, like posts and comment on them. What’s more interesting is that after learning things from this article, going forward you will be able to implement a lot of other features on your own.

In this first part of the series they start you off with the base code and introduce you to how the data is stored. They also walk you through how the "stream" part of the code works and the tracking of the current user. From there, there's a brief look at how to pull out the comments and display them to the page.

tagged: social post tutorial mongodb jquery part1 series

Link: http://www.sitepoint.com/social-network-style-posting-php-mongodb-jquery-part-1/

DesignShack.com:
How to Build a Dynamic Imgur Upload App Using jQuery & PHP
Aug 30, 2013 @ 14:51:03

On DesignShack.com Jake Rocheleau has a tutorial showing you how to create an image uploader that pushes the image over to the Imgr service.

In this tutorial I want to demonstrate how we can remotely mirror an image found elsewhere online and auto-upload to Imgur. It’s possible to create a form handling user-uploaded images as well. But I wanted to keep the demo clean without needing to move user content onto the server. This process is very simple once you understand how APIs work.

He provides all of the code and guidance you'll need to get the system working. It uses a simple HTML layout, some jQuery for submitting the image data back to the the server and a PHP script to call the Imgr API. It uses curl to make the call, so you'll need that extension installed to use the example. You can check out the live demo or just download the source to get started quickly.

tagged: imgr upload jquery tutorial javascript api curl

Link: http://designshack.net/articles/javascript/how-to-build-a-dynamic-imgur-upload-app-using-jquery-php/

Gonzalo Ayuso:
Working with jQuery and Silex as RestFull Resource provider
Jun 10, 2013 @ 17:40:01

In a previous post Gonzalo Ayuso showed how to use Silex as a data provider to an AngularJS application REST-fully. In this new post he does the same thing but with jQuery this time.

The previous post was about how to use AngularJS resources with Silex. AngularJS is great and when I need to switch back to jQuery it looks like I go back 10 years in web development, but business is business and I need to live with jQuery too. Because of that this post is about how to use the Silex RestFull resources from the previous post, now with jQuery.

He includes the sample code showing the jQuery version of the application based on a "Resource" object. He also includes some samples of its use for the usual CRUD operations. You can get the full code from github.

tagged: jquery rest tutorial resource silex provider

Link: http://gonzalo123.com/2013/06/10/working-with-jquery-and-silex-as-restfull-resource-provider

Miro Svrtan:
Debugging Uploadify jQuery plugin with XDebug
Aug 30, 2012 @ 15:50:01

Miro Svrtan has a quick tip for those using the Uploadify plugin in their application's file uploads - how to enable XDebug debugging on each upload request.

If you ever decided to use Uploadify jQuery plug-in you might have noticed problems with debugging remote PHP code that this plugin relies on. [...] Unfortunately setting this up will not work with Uploadify Flash version since calls to remote server side is not done inside browser but inside flash plugin. [...] Few months ago I found my self blindly debugging it again and remembered that I read somewhere that xdebug parameters can be sent via GET/POST too.

He takes advantage of this fact and appends the "XDEBUG_SESSION_START" and "XDEBUG_SESSION" values in the "scriptData" handler for the Uploadify call. The XDebug session is then started when the script executes and your IDE will receive the results.

tagged: debug uploadify jquery plugin xdebug scriptdata tutorial

Link:

Smashing Magazine:
Writing Unit Tests For WordPress Plugins
Mar 09, 2012 @ 16:46:32

On the Smashing Magazine site there's a recent post looking at how to unit test WordPress plugins via the frontend using QUnit (part of the jQuery project).

My first goal for the WordPress Editorial Calendar was to make it do anything useful. I was new to JavaScript and PHP and didn't really know what I could pull off. In a few days I had a proof of concept. In a few more I had a working version and was asking friends to install it. The calendar worked...sort of. I spent three times as much time fixing bugs as I did coding. Once the plugin worked, I wrote unit tests to make sure it kept working.

He introduces the QUnit testing tool and includes some sample tests showing you how to create both a pass/fail and how to test a PHP value passed out to the page via PHP. There's also a section on getting WordPress and QUnit integrated and only executing when there's a "qunit" parameter on the URL. Actual tests for his calendar plugin are included and you can see the results of the tests here.

tagged: wordpress plugin unittest javascript jquery qunit

Link:

Script-Tutorials.com:
Form Validation with Javascript and PHP
Feb 02, 2012 @ 15:07:40

On the Script-Tutorials.com site today there's a new tutorial about form validation using a combination of jQuery on the frontend and PHP on the backend.

In this tutorial, I will show you how to create an attractive, pleasant to look form for your website and then I will explain you how to dynamically validate them using Javascript. We'll also cover server-side validation with PHP to make everything 100% safe. This tutorial will help you to add more functionality to your forms which leads to better user experience and better quality of your website.

His sample form (name, password, email and gender) is made from some pretty simple HTML markup. The real trick comes with the jQuery validation on each field handled in an onKeyUp. Included are both a "password strength" method and an email validation method to check the format of the address. Errored fields have their background color changed to indicate that they've failed and some basic validation (length, password match, etc.) are also included. The PHP does much of the same validation once the form is posted and returns any error messages that might have come up.

You can download the code or try out a live demo to see the scripts together in action.

tagged: form validation jquery javascript frontend backend tutorial

Link:


Trending Topics: