ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalITEC3111Input Validation
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    ITEC3111

    Web Engineering

    Progress0 / 24 done
    Topics24
    1Web programming languages (HTML5, CSS3, JavaScript, PHP/JSP/ASP.Net)2HTML53CSS34JavaScript5PHP6JSP7ASP.Net8Design principles of Web based applications9Web platform constraints10Software as a Service (SaaS)11Web standards12Responsive Web Design13Web Applications14Browser/Server Communication15Storage Tier16Cookies and Sessions17Input Validation18Full stack state management19Web App Security - Browser Isolation20Network Attacks and Session Attacks21Large scale applications22Performance of Web Applications23Data Centers24Web Testing and Web Maintenance
    3 min read
    Topic 17 of 24
    Topic Study Note Illustration
    17

    Input Validation

    Input Validation is the process of checking and verifying user input before it is processed by a web application to ensure it is correct, safe, and in...

    ✅ Input Validation (Web Engineering)


    📌 1. Definition

    Input Validation is the process of checking and verifying user input before it is processed by a web application to ensure it is correct, safe, and in expected format.

    👉 It is used to prevent invalid data and security attacks.


    🎯 2. Purpose of Input Validation

    • Ensure data accuracy
    • Prevent security attacks
    • Improve system reliability
    • Maintain data integrity

    🧠 3. Why Input Validation is Important

    Web applications accept input from users, such as:

    • Login forms
    • Registration forms
    • Search fields

    👉 Without validation, attackers can inject harmful data.


    ⚠️ 4. Risks Without Input Validation

    • SQL Injection attacks
    • Cross-Site Scripting (XSS)
    • Data corruption
    • System crashes
    • Unauthorized access

    🧩 5. Types of Input Validation


    1. 🟢 Client-Side Validation

    📌 Definition

    Validation performed in the browser (user side) using JavaScript or HTML.

    🔑 Features

    • Fast response
    • Improves user experience
    • Can be bypassed (less secure)

    ✅ Example

    if (name == "") {
      alert("Name is required");
    }
    

    2. 🔵 Server-Side Validation (Most Important)

    📌 Definition

    Validation performed on the server after data submission.

    🔑 Features

    • Highly secure
    • Cannot be bypassed easily
    • Slower than client-side

    ✅ Example (PHP)

    if(empty($_POST["name"])) {
      echo "Name is required";
    }
    

    📊 6. Input Validation Flow Diagram

    User Input → Client-Side Check → Server-Side Check → Process Data → Store in Database
    

    🧠 7. Common Validation Rules

    • Required fields must not be empty
    • Email must follow correct format
    • Password must meet security rules
    • Numbers must be within range
    • No special characters in name fields

    🧩 8. Techniques of Input Validation


    1. 🧾 Data Type Check

    • Ensures correct type (text, number, email)

    2. 📏 Length Check

    • Ensures input is within allowed size

    3. 🔤 Format Check

    • Example: email format user@example.com

    4. 🚫 Range Check

    • Example: Age must be between 18–60

    5. 🧹 Sanitization

    • Removes harmful characters
    • Prevents injection attacks

    🔐 9. Security Role of Input Validation

    Input validation protects against:

    • SQL Injection
    • XSS (Cross-Site Scripting)
    • Command Injection

    📈 10. Advantages

    • Improves security
    • Ensures data accuracy
    • Prevents system errors
    • Enhances reliability
    • Reduces malicious attacks

    ❌ 11. Disadvantages

    • Extra processing time
    • Complex implementation
    • Requires careful design

    ⚠️ 12. Important Rules

    ✔ Always validate on server-side (mandatory) ✔ Client-side validation is only for user convenience ✔ Never trust user input ✔ Use both client + server validation ✔ Sanitize data before database storage


    ❓ 13. Likely Exam Questions

    Short Questions

    1. Define input validation.
    2. Why is input validation important?
    3. What is client-side validation?
    4. What is server-side validation?
    5. Name types of input validation.

    Long Questions

    1. Explain input validation with diagram.
    2. Discuss client-side and server-side validation.
    3. Explain techniques of input validation.
    4. What are security risks without input validation?
    5. Describe role of input validation in web security.

    📝 14. Summary / Quick Revision

    • Input validation = checking user input before processing

    • Types:

      • Client-side (fast but weak security)
      • Server-side (secure and essential)
    • Prevents:

      • SQL injection
      • XSS
    • Ensures safe, clean, and valid data


    👉 In short: Input validation is the first line of defense in web application security.


    ← Previous topic 16
    Cookies and Sessions
    Next topic 18 →
    Full stack state management

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    508words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Web Engineering