Docsity

Web engineering, Essays (high school) of Web Design and Development

Toggle sidebar
bg1
Web Engineering Mid Notes By: Aqib
Aziz
Q1: Form Validation:
There are two types of form validation.
1. Basic Validation
2. Data format Validation
Basic Validation:
In basic validation, we check the required fields are filled. If all fields are filled then basic validation is
complete otherwise it shows error.
Data format Validation:
Data validation is the process of ensuring that a program operates on clean, correct and useful data. It
uses routines, often called "validation rules" "validation constraints" or "check routines", that check for
correctness, meaningfulness, and security of data that are input to the system.
Form Validation Code:
<html>
<head>
<title> Registration Form </title>
</head>
<body>
<center>
<h1> <u>Registration Form </u> </h1>
<form method = "post" action = "reg.php" name = "frm1" >
User Name: <input type = "text" name = "name" placeholder = "User Name" pattern = "[A-Z a-z 0-9]"
required /> </br>
Password: <input type = "password" name = "pas" placeholder = "Password" pattern = "(?=.*\d)(?=.*[A-
z]).{4,}" required /> </br>
Re type-Password: <input type = "password" name = "repas" placeholder = "Re type-Password" pattern
= "(?=.*\d)(?=.*[A-z]).{4,}" required /> </br>
pf3
pf4
pf5

Partial preview of the text

Download Web engineering and more Essays (high school) Web Design and Development in PDF only on Docsity!

Web Engineering Mid Notes By: Aqib Aziz

Q1: Form Validation:

There are two types of form validation.

  1. Basic Validation
  2. Data format Validation

Basic Validation:

In basic validation, we check the required fields are filled. If all fields are filled then basic validation is complete otherwise it shows error.

Data format Validation:

Data validation is the process of ensuring that a program operates on clean, correct and useful data. It uses routines, often called "validation rules" "validation constraints" or "check routines", that check for correctness, meaningfulness, and security of data that are input to the system.

Form Validation Code:

Registration Form

Registration Form

User Name:

Password:

Re type-Password:

Date of Birth:

Mobile No:

Email:

Date:

CNIC:

Gender: Male

Female

Select Country:

Select City:

QNO3: Types of Casecading Style Sheet:

CSS:

Most web pages are made from HTML , or hypertext markup language. This is the standard way to decorate plain web text with fonts, colors, graphic doodads, and hyperlinks (clickable text that magically transports the user somewhere else). But websites can get really big. When that happens, HTML is a very hard way to do a very easy thing. CSS (cascading style sheets) can make decorating web sites easy again!

Think of CSS as a kind of computer dress code. CSS mainly does just one thing: it describes how web pages should look. Even better, CSS can be easily separated from HTML, so that the dress code is easy to find, easy to modify, and can rapidly change the entire look of your web site. Like a dress code at school, you can change your CSS and the look of your students will change with it. Style sheets allow you to rapidly alter entire websites as you please, just like a fashion craze allows people to change with the times yet remain the same people. A really neat thing about CSS, is that it cascades. Each style you define adds to the overall theme, yet you can make the most recent style override earlier styles. For example, with CSS we can start by saying we want all of our text 12px (12 units) high. Later we can say we want it to be red, too. Still later, we can tell it we want one phrase to be in bold or italics, or blue rather than red. See? That's a cascade. Three Types of CSS CSS comes in three types:

  • In a separate file ( external )
  • At the top of a web page document ( internal )
  • Right next to the text it decorates ( inline ) External : Style sheets are separate files full of CSS instructions (with the file extension .css). When any web page includes an external stylesheet, its look and feel will be controlled by this CSS file (unless you decide to override a style using one of these next two types). This is how you change a whole website at once. And that's perfect if you want to keep up with the latest fashion in web pages without rewriting every page.

Example:

This is a heading

This is a paragraph.

/* CSS Document */ .heading

Font-color=”red”; } .paragraph { Font-color=”green”; }

Internal : Styles are placed at the top of each web page document, before any of the content is listed. This is the next best thing to external, because they're easy to find, yet allow you to 'override' an external style sheet -- for that special page that wants to be a nonconformist! Example:

This is a heading

This is a paragraph.

$name=$_POST[;txtuname’]

$pass=$_POST[;txtpass’] $con=mysqli_connect(“localhost” ,”root”,””,”NCBA”); If(!con) { Die(“connection failed”,”mysqli_error()); } Else { $sql=” select * from personal”; $result= mysqli_querry($con,$sql); mysqli_num_rows($result); $dbusername = $row['$username_login']; $dbpassword = $row['$password_login']; if ($txtuname==$dbusername && $txtpass==$dbpassword) { { echo "You are in"; } else { echo "Invalid Username or Password "; }

}