Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building a Web Application with PHP and MariaDB: A Reference Guide

You're reading from   Building a Web Application with PHP and MariaDB: A Reference Guide Build fast, secure, and interactive web applications using this comprehensive guide

Arrow left icon
Product type Paperback
Published in Jun 2014
Publisher
ISBN-13 9781783981625
Length 200 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Sai S Sriparasa Sai S Sriparasa
Author Profile Icon Sai S Sriparasa
Sai S Sriparasa
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. CRUD Operations, Sorting, Filtering, and Joins 2. Advanced Programming with MariaDB FREE CHAPTER 3. Advanced Programming with PHP 4. Setting Up Student Portal 5. Working with Files and Directories 6. Authentication and Access Control 7. Caching 8. REST API 9. Security 10. Performance Optimization Index

Securing PHP

In this section, we will go over the possible security issues on the application side. It is always recommended to filter the content on the server. The filtering can be performed at various levels. We can begin by verifying if the type of the input that we expect is the same as the type of the input we get. We can use PHP's functions such as is_int, is_numeric, is_float, and is_string, explained as follows:

  • is_int: This function is used to verify if the input is an integer
  • is_numeric: This function is used to verify if the input is a number or a numeric string
  • is_float: This function is used to verify if the input is a floating-point number
  • is_string: This function is used to verify if the input is a string

Once we verify that the incoming input is same as expected, we can look for any cross-site scripting vulnerability that the incoming input may carry. To prevent any cross-site scripting vulnerability from creeping in, it is always advisable to filter the data before storing...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime