Form validation server side

Главная » Tutorials » PHP » Form validation server side

Today we’ll consider data validation on server side with build-in php functions. Any html form is potential danger for your project because of information from this form. User not necessary wants to hurt you. He can enter some spaces. Spaces are not a problem, but you are recommended to store clean data.

In this tutorial we will consider several situations%

  1. xss injection detection – we will use strip_tags function
  2. remove spaces – we will use trim function
  3. if you wish to use html tags in input , for this purpose php has hot htmlspecialchars function. This function modify tags into html entities. You can find codes of these entities in Internet.
    For example, this link.

Подписаться на рассылку

Будьте в курсе - получайте последние статьи на свой email

Ваша подписка успешно оформлена

Pin It on Pinterest

Share This