Skip to main content
main-content
Top

About this book

Take advantage of the improved performance and reduced memory requirements of PHP version 7, and learn to utilize the new built-in PHP functions and features such as typed variable enforcement with declare(strict_types=1) and the new available data types, scalar type declarations for function arguments and return statements, constant arrays using define(), argument unpacking with the ... operator, integer division with intdiv(), the null coalesce operator, the spaceship operator, new exception types, and improvements to existing features.

Pro PHP and jQuery, Second Edition is for intermediate level programmers interested in building web applications using jQuery and PHP. Updated for PHP version 7 and the latest version of jQuery, this book teaches some advanced PHP techniques and it shows you how to take your dynamic applications to the next level by adding a JavaScript layer using the jQuery framework and APIs.

After reading and using this book, you'll come away having built a fully functional PHP and jQuery web application that you can reapply as a template for your own particular web application.

Pro PHP and jQuery, Second Edition is for intermediate level programmers interested in building web applications using jQuery and PHP. Updated for PHP version 7 and the latest version of jQuery, this book teaches some advanced PHP techniques and it shows you how to take your dynamic applications to the next level by adding a JavaScript layer using the jQuery framework and APIs, considered the most popular JavaScript libraries.

After reading and using this book, you'll come away understanding a fully functional PHP using jQuery web application case study that you can reapply as a template for your own particular web application.

Moreover, from PHP 7, you'll get uniform variable syntax, the AST-based compilation process, the added Closure::call(), bitwise shift consistency across platforms, the (null coalesce) operator, Unicode codepoint escape syntax, return type declarations, and new and easier extensions development with support for redis, MongoDB and much more.

Table of Contents

Getting Comfortable with jQuery

Frontmatter

Chapter 1. Introducing jQuery

To fully understand jQuery and its applications in modern web programming, it’s important to take a moment and look back at where jQuery came from, what needs it was built to fulfill, and what programming in JavaScript was like before jQuery came around.
Jason Lengstorf, Keith Wald

Chapter 2. Common jQuery Actions and Methods

Now that you understand how element selection works, you can start learning the basics of how jQuery simplifies interaction with web pages. In this chapter, you’ll get your hands dirty with the most common and useful aspects of jQuery.
Jason Lengstorf, Keith Wald

Getting Into Advanced PHP Programming

Frontmatter

Chapter 3. Object-Oriented Programming

In this chapter, you’ll learn the concepts behind object-oriented programming (OOP), a style of coding in which related actions are grouped into classes to aid in creating more-compact, effective code. The back end of the project you’ll be building in this book is heavily based on OOP, so the concepts covered in this chapter will be referenced often throughout the rest of the exercises you’ll complete.
Jason Lengstorf, Keith Wald

Chapter 4. Build an Events Calendar

Now that you’re up to speed on the concept of object-oriented programming, you can start working on the project that will be the meat and potatoes of this book: the events calendar. It all starts here, and as this book progresses, you’ll be adding more and more functionality using both PHP and jQuery.
Jason Lengstorf, Keith Wald

Chapter 5. Add Controls to Create, Edit, and Delete Events

Now that the calendar can be viewed, you need to add controls that will allow administrators to create, edit, and delete events.
Jason Lengstorf, Keith Wald

Chapter 6. Password Protecting Sensitive Actions and Areas

Now that your app can add, edit, and remove events, you need to protect those actions by requiring users to log in before they can make any changes. You’ll need to create a new table in the database and a new class in the app to make this happen; you’ll also need to make a few modifications to existing files.
Jason Lengstorf, Keith Wald

Combining jQuery with PHP Applications

Frontmatter

Chapter 7. Enhancing the User Interface with jQuery

The application as it stands now is fully functional. Events can be viewed, and users with administrative clearance can log in to create, edit, or delete events.
Jason Lengstorf, Keith Wald

Chapter 8. Editing the Calendar with AJAX and jQuery

Now that your app can display event data without a page refresh, you can see the added convenience provided by AJAX in web applications. Historically, one of the biggest pitfalls of using web apps has been the fact that each action, no matter how small, usually required waiting for the page to refresh while the setting was saved. Web apps were convenient when a user needed access to his information on a shared computer, but the slow workflow was usually enough to make users lean toward desktop applications whenever possible.
Jason Lengstorf, Keith Wald

Advancing jQuery and PHP

Frontmatter

Chapter 9. Performing Form Validation with Regular Expressions

It’s your responsibility as a developer to ensure that your users’ data is useful to your app, so you need to confirm that critical information is validated before storing it in your database.
Jason Lengstorf, Keith Wald

Chapter 10. Extending jQuery

jQuery’s easy-to-use syntax led developers to begin writing scripts to achieve custom effects and other tasks. To make these scripts configurable and reusable, these developers constructed them as plug-ins, or scripts that extend jQuery by adding new methods to the library. In this chapter, you’ll learn how to add your own plug-ins to jQuery.
Jason Lengstorf, Keith Wald

Appendix A. Brief Notes on PHP 7

In this appendix, we briefly examine some of the changes made in version 7 of the PHP language.
Jason Lengstorf, Keith Wald
Additional information