ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Web Engineering
    ITEC3111
    Progress0 / 24 topics
    Topics
    1. Web programming languages (HTML5, CSS3, JavaScript, PHP/JSP/ASP.Net)2. HTML53. CSS34. JavaScript5. PHP6. JSP7. ASP.Net8. Design principles of Web based applications9. Web platform constraints10. Software as a Service (SaaS)11. Web standards12. Responsive Web Design13. Web Applications14. Browser/Server Communication15. Storage Tier16. Cookies and Sessions17. Input Validation18. Full stack state management19. Web App Security - Browser Isolation20. Network Attacks and Session Attacks21. Large scale applications22. Performance of Web Applications23. Data Centers24. Web Testing and Web Maintenance
    ITEC3111›Input Validation
    Web EngineeringTopic 17 of 24

    Input Validation

    3 minread
    508words
    Beginnerlevel

    ✅ 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 load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time3 min
      Word count508
      Code examples0
      DifficultyBeginner