SlideShare une entreprise Scribd logo
1  sur  15
PHP Validation Basics
Overview
Objective

Learn the native features of validation in ProdigyView.

Requirements

 Understanding of mime types
 Basic knowledge of the file manager
Estimated Time

8 Minutes


                      www.prodigyview.com
Follow Along With Code Example
1. Download a copy of the example code at
  www.prodigyview.com/source.
2. Install the system in an environment you feel comfortable testing in.
3. Proceed to examples/util/Validation.php
Validation
Validation is process of the checking data against a set of
parameters. If the parameters match, a true is returned,
otherwise false.

Validation can be used internally but it most commonly
used with checking user input.

In this tutorial, we will be briefly introducing you to
common validation used in PHP and its native
implementation in ProdigyView.




                       www.prodigyview.com
Integer Validation
Integer validation is a good point to start. An example
usage is many SQL databases use auto incremented ids
which are integers. You may want to verify that the id they
are going to use to update a record is an integer.
Double Validation
Double validation will cover validation for types double,
floats, longs, and anything else that contains a period
and a number. Passing an integer to double validation
will fail.




                      www.prodigyview.com
Email Validation
A common validation with web applications is the email.
You want the user who is registering for the application to
at least enter a real email.
Audio File Type
On your way to making the next Pandora? In that case
you want audio file mime type validation. While the
example below checks all audio mime types, it can be
further specified to check only one type.




 Supported validation formats:
 mp3, wav, ra, oga, midi, aif
Video File Types
 Similar to the audio file type, video mime types can also be
 validated. The example below is also all inclusive but video mime
 types can be checked individually.




Supported Validation Formats:
ogv, mpeg, wmv, mp4, flv, quicktime, mov, mxu , avi, real
video, asf, webm
Image File Types
Check image file types before deciding to accept them.
Below is the method checking all images types but they
can also be checked individually.




Supported Validation Formats: png, gif, jpeg, ief, bmp,
tiff
Compress Files
Compressed files include zip, tar and gtar. Validate that
the file is actually a compressed file and does not merely
have the extension of a compressed file.




                      www.prodigyview.com
Microsoft Files

Microsoft files include Word, Excel and Powerpoint. Divided
further, we have .doc, docx and so forth, each which has
different mime-types. In ProdigyView, we can validate
against any of those Microsoft file types.




                       www.prodigyview.com
Other Validation
This tutorial only showed a brief overview native validation
in ProdigyView. There are many more validation type
available, read through the api.
There is also the ability to add custom validation to
PVValidator in the tutorial on ‘Custom Validation’.


           Other Native Validation Examples

 isValidUrl                      IsCSSFile
 isActiveUrl
 isPdf
 isID                www.prodigyview.com
Challenge!
This is optional challenge that will help you better
understand Validation and File Management.

1. Located a video file on your computer/server.
2. With PVFileManager, retrieve the mime type of the
   video file

3. Check against the file type specifically. Example, if the
   video file is an avi, validate ONLY against avi files.

4. If the validation passed, copy the file to another
   location using PVFileManager.


                      www.prodigyview.com
API Reference
For a better understanding of Validation in ProdigyView, visit
the api by clicking on the link below.

PVValidator




                   More Tutorials
  For more tutorials, please visit:

  http://www.prodigyview.com/tutorials


                         www.prodigyview.com

Contenu connexe

En vedette

Memphis php html form processing with php
Memphis php   html form processing with phpMemphis php   html form processing with php
Memphis php html form processing with php
Joe Ferguson
 
Php Form
Php FormPhp Form
Php Form
lotlot
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
Harit Kothari
 
Creating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login SystemCreating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login System
Azharul Haque Shohan
 

En vedette (15)

Memphis php html form processing with php
Memphis php   html form processing with phpMemphis php   html form processing with php
Memphis php html form processing with php
 
Php Form
Php FormPhp Form
Php Form
 
Principles of MVC for PHP Developers
Principles of MVC for PHP DevelopersPrinciples of MVC for PHP Developers
Principles of MVC for PHP Developers
 
Network Simulation NS3
Network Simulation NS3Network Simulation NS3
Network Simulation NS3
 
ns-3: History and Future
ns-3: History and Futurens-3: History and Future
ns-3: History and Future
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
 
Creating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login SystemCreating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login System
 
Building Topology in NS3
Building Topology in NS3Building Topology in NS3
Building Topology in NS3
 
Tutorial ns 3-tutorial-slides
Tutorial ns 3-tutorial-slidesTutorial ns 3-tutorial-slides
Tutorial ns 3-tutorial-slides
 
ns-3 Tutorial
ns-3 Tutorialns-3 Tutorial
ns-3 Tutorial
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
Scrum In 15 Minutes
Scrum In 15 MinutesScrum In 15 Minutes
Scrum In 15 Minutes
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 

Plus de ProdigyView

Plus de ProdigyView (20)

Installing Plug-ins
Installing Plug-insInstalling Plug-ins
Installing Plug-ins
 
Building An Application
Building An ApplicationBuilding An Application
Building An Application
 
Installing Applications
Installing ApplicationsInstalling Applications
Installing Applications
 
Video Content Management
Video Content ManagementVideo Content Management
Video Content Management
 
Audio Content Management
Audio Content ManagementAudio Content Management
Audio Content Management
 
File Content Management
File Content ManagementFile Content Management
File Content Management
 
Email Configuration
Email ConfigurationEmail Configuration
Email Configuration
 
HTML5 Tags and Elements Tutorial
HTML5 Tags and Elements TutorialHTML5 Tags and Elements Tutorial
HTML5 Tags and Elements Tutorial
 
HTML Forms Tutorial
HTML Forms TutorialHTML Forms Tutorial
HTML Forms Tutorial
 
Html Tags Tutorial
Html Tags TutorialHtml Tags Tutorial
Html Tags Tutorial
 
Video Conversion PHP
Video Conversion PHPVideo Conversion PHP
Video Conversion PHP
 
Sending Email Basics PHP
Sending Email Basics PHPSending Email Basics PHP
Sending Email Basics PHP
 
Tools ProdigyView
Tools ProdigyViewTools ProdigyView
Tools ProdigyView
 
Custom Validation PHP
Custom Validation PHPCustom Validation PHP
Custom Validation PHP
 
Basic File Cache Tutorial - PHP
Basic File Cache Tutorial - PHPBasic File Cache Tutorial - PHP
Basic File Cache Tutorial - PHP
 
Understanding Web Cache
Understanding Web CacheUnderstanding Web Cache
Understanding Web Cache
 
Javascript And CSS Libraries
Javascript And CSS LibrariesJavascript And CSS Libraries
Javascript And CSS Libraries
 
PHP Libraries
PHP LibrariesPHP Libraries
PHP Libraries
 
SQL Prepared Statements Tutorial
SQL Prepared Statements TutorialSQL Prepared Statements Tutorial
SQL Prepared Statements Tutorial
 
Database Basics
Database BasicsDatabase Basics
Database Basics
 

Dernier

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

PHP Validation Basics

  • 2. Overview Objective Learn the native features of validation in ProdigyView. Requirements  Understanding of mime types  Basic knowledge of the file manager Estimated Time 8 Minutes www.prodigyview.com
  • 3. Follow Along With Code Example 1. Download a copy of the example code at www.prodigyview.com/source. 2. Install the system in an environment you feel comfortable testing in. 3. Proceed to examples/util/Validation.php
  • 4. Validation Validation is process of the checking data against a set of parameters. If the parameters match, a true is returned, otherwise false. Validation can be used internally but it most commonly used with checking user input. In this tutorial, we will be briefly introducing you to common validation used in PHP and its native implementation in ProdigyView. www.prodigyview.com
  • 5. Integer Validation Integer validation is a good point to start. An example usage is many SQL databases use auto incremented ids which are integers. You may want to verify that the id they are going to use to update a record is an integer.
  • 6. Double Validation Double validation will cover validation for types double, floats, longs, and anything else that contains a period and a number. Passing an integer to double validation will fail. www.prodigyview.com
  • 7. Email Validation A common validation with web applications is the email. You want the user who is registering for the application to at least enter a real email.
  • 8. Audio File Type On your way to making the next Pandora? In that case you want audio file mime type validation. While the example below checks all audio mime types, it can be further specified to check only one type. Supported validation formats: mp3, wav, ra, oga, midi, aif
  • 9. Video File Types Similar to the audio file type, video mime types can also be validated. The example below is also all inclusive but video mime types can be checked individually. Supported Validation Formats: ogv, mpeg, wmv, mp4, flv, quicktime, mov, mxu , avi, real video, asf, webm
  • 10. Image File Types Check image file types before deciding to accept them. Below is the method checking all images types but they can also be checked individually. Supported Validation Formats: png, gif, jpeg, ief, bmp, tiff
  • 11. Compress Files Compressed files include zip, tar and gtar. Validate that the file is actually a compressed file and does not merely have the extension of a compressed file. www.prodigyview.com
  • 12. Microsoft Files Microsoft files include Word, Excel and Powerpoint. Divided further, we have .doc, docx and so forth, each which has different mime-types. In ProdigyView, we can validate against any of those Microsoft file types. www.prodigyview.com
  • 13. Other Validation This tutorial only showed a brief overview native validation in ProdigyView. There are many more validation type available, read through the api. There is also the ability to add custom validation to PVValidator in the tutorial on ‘Custom Validation’. Other Native Validation Examples  isValidUrl  IsCSSFile  isActiveUrl  isPdf  isID www.prodigyview.com
  • 14. Challenge! This is optional challenge that will help you better understand Validation and File Management. 1. Located a video file on your computer/server. 2. With PVFileManager, retrieve the mime type of the video file 3. Check against the file type specifically. Example, if the video file is an avi, validate ONLY against avi files. 4. If the validation passed, copy the file to another location using PVFileManager. www.prodigyview.com
  • 15. API Reference For a better understanding of Validation in ProdigyView, visit the api by clicking on the link below. PVValidator More Tutorials For more tutorials, please visit: http://www.prodigyview.com/tutorials www.prodigyview.com