You are on page 1of 38

PROJECT REPORT

ON

SUBJECT NOTES
Submitted to MAHARAJA RANJIT SINGH PUNJAB TECHNICAL UNIVERSITY
in partial fulfillment of the requirement of the award of the degree of

B.TECH
in

COMPUTER SCIENCE & ENGINEERING

Submitted By

PARAS MISHRA JASKIRAT SINGH


(190280150) (190280058)

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

GIANI ZAIL SINGH CAMPUS COLLEGE OF ENGINEERING&


TECHNOLOGY, MRSPTU, BATHINDA-151001
DEC 2022

1
PROJECT REPORT
ON

SUBJECT NOTES

Submitted to MAHARAJA RANJIT SINGH PUNJAB TECHNICAL UNIVERSITY


in partial fulfillment of the requirement of the award of the degree of

B.TECH

In

COMPUTER SCIENCE & ENGINEERING


Submitted By

PARAS MISHRA JASKIRAT SINGH


( Roll No. 190280150) (Roll No. 190280058)

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

GIANI ZAIL SINGH CAMPUS COLLEGE OF ENGINEERING &


TECHNOLOGY, MRSPTU, BATHINDA-151001
DEC 2022

2
PREFACE
Project is an integral part of B. Tech and each and every student has to undergo the
report for in a institute.

This record is concerned about our practical training during the 7 th semester of our
B.Tech. I have taken my Practical project .During this training, We got to learn
many new things about web development and the current requirements of
companies. This project proved to be a milestone in our knowledge of present
industry. Every say and every moment was an experience in itself, an experience
which theoretical study can’t provide.

3
ACKNOWLEDGEMENT
It is my pleasure to be indebted to various people, who directly or indirectly contributed in the
development of this work and who influenced my thinking, behavior and acts during the course
of study.

I express my sincere gratitude to Er.Jyoti Rani worthy HOD and Er. Naresh Garg, Report for
providing me an opportunity to undergo project lab.

I am thankful to Er. Naresh Garg for his support, cooperation, and motivation provided to me
during the training for constant inspiration, presence and blessings.

I also extend my sincere appreciation to all my friends who provided their valuable suggestions
and precious time in accomplishing my project report.

Lastly, I would like to thank the almighty and my parents for their moral support and my friends
with whom I shared my day-to-day experience and received lots of suggestions that my quality
of work.

PARAS MISHRA

JASKIRAT SINGH

4
DECLARATION

I, PARAS MISHRA AND JASKIRAT SINGH, Roll No. 190280058, 190280150 respectively,
B.Tech (Semester- VII) of the Giani Zail Singh Campus College of Engineering &
Technology, Bathinda hereby declare that the Project Report entitled “SUBJECT NOTES” is
an original work and data provided in the study is authentic to the best of my knowledge. This
report has not been submitted to any other Institute for the award of any other degree.

PARAS MISHRA
JASKIRAT SINGH

Place:
Date:

5
CONTENTS

1. WEB DEVELOPMWNT INTRODUCTION 7-8

2. INTRODUCTION TO HTML 8-15

3. INTODUCTION TO CSS 15-20

4. INTRODUCTION TO BOOTSTRAP 20-22

5. INTRODUCTION TO JAVASCRIPT 22-25

6. INTRODUCTION TO PHP 26-33

7. WEB DEVELOPMENT PROJECT 33- 34

8. RESULT AND DISCUSSION 34-35

9. CONCLUSION AND SCOPE 35-36

6
CHAPTER 1:Introduction to Web development

1.1.1 What is web development?


Web development is the work involved in developing a website for the Internet (World Wide Web) or
an intranet (a private network). Web development can range from developing a simple single static
page of plain text to complex web applications, electronic businesses, and social network services. A
more comprehensive list of tasks to which Web development commonly refers, may include Web
engineering, Web design, Web content development, client liaison, client-side/server-side
scripting, Web server and network security configuration, and e-commerce development.

1.1.2 Who is Web Developer


A web developer is at heart an interactive artist. They’re someone driven by a deep desire to
creat things. A web developer’s canvas is a user’s web browser.

Much like how a curious child takes


pleasure in making toys by joining LEGO blocks—and then experiences a similar joy in taking things
apart to see how they’re made, a web developer’s job is to use the basic building blocks of the web
(like HTML, CSS and JavaScript) to create something complex like a webpage. Don’t sweat it! We’ll
get into all of those terms soon.

1.2.1 Types of web developers

There are different types of web developers who focus on different areas. These include:

 Frontend developers: Frontend developers implement web page designs using HTML
and CSS. They make sure the website looks pretty on different devices, and that the forms
and buttons work.
 Backend developers: Backend developers create the backbone of the web application. They
write code logic that handles a user’s input (for example, what should happen when you
click the signup button after filling in a form).
 Full stack developers: Full stack developers do bits of both backend and frontend. Depending
on the problem at hand, they can switch cape and move stacks.

CHAPTER 2:- INDRODUCTION TO HTML

2.1.1 : WHAT IS HTML

 HTML stands for Hyper Text Markup Language


 HTML is the standard markup language for creating Web pages
 HTML describes the structure of a Web page
 HTML consists of a series of elements
7
 HTML elements tell the browser how to display the content
 HTML elements label pieces of content such as "this is a heading", "this is a
paragraph", "this is a link", etc.

2.1.2 : A Simple HTML Example


<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html>

2.1.3 : A Simple HTML Example Explained

 The <!DOCTYPE html> declaration defines that this document is an HTML5


document
 The <html> element is the root element of an HTML page
 The <head> element contains meta information about the HTML page
 The <title> element specifies a title for the HTML page (which is shown in the
browser's title bar or in the page's tab)
 The <body> element defines the document's body, and is a container for all the visible
contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
 The <h1> element defines a large heading
 The <p> element defines a paragraph

2.1.4 : What is HTML Elements


An HTML element is defined by a start tag,some content,and an end tag;

<tagname>Content goes here…</tagname>


The HTML element is everything form start tag to the end tag:
<h1> My First Heading</h1>
<p>My first paragraph.</p>

2.2.1 : HTML ATTRIBUTES


 All HTML elements can have attributes
 Attributes provide additional information about elements
 Attributes are always specified in the start tag

8
 Attributes usually come in name/value pairs like:name=” value”

# The href Attribute

The <a>tag defines a hyperlink.the href attributes specifies the URL of the page

The link goes like:Example:<a href=” google.com”>google</a>

# The src Attribute

The <img> tag is used to embed an image in an HTML page. The src attribute specifies the path
to the image to be displayed:

Example:

<img src="food.jpg">

# The width and height Attributes

The <img> tag should also contain the width and height attributes, which specifies the width and height of the
image (in pixels):

Example:

<img src="food.jpg" width="500" height="600">

# The alt Attribute

The required alt attribute for the <img> tag specifies an alternate text for an image, if the image for
some reason cannot be displayed. This can be due to slow connection, or an error in the src attribute, or
if the user uses a screen reader.

Example

<img src="food.jpg" alt="Burger">

2.3.1: HTML Headings


HTML headings are titles or subtitles that you want to display on a webpage.

HTML headings are defined with the <h1> to <h6> tags. <h1> defines the most important
heading. <h6> defines the least important heading.

9
Example:

Input: <h1>Heading 1</h1>


<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Output:

Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6

2.4.1:HTML Paragraph
The HTML <p> element defines a paragraph.

A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before
and after a paragraph.

Example:

<p>This is a paragraph.</p> //This ia a paragraph


<p>This is another paragraph.</p> //This is a another paragraph

2.5.1: HTML Horizontal Rule

The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal
rule. The <hr> element is used to separate content (or define a change) in an HTML page:

Example:

<h1>This is heading 1</h1>

<p>This is some text.</p>

<hr>

10
<h2>This is heading 2</h2>

<p>This is some other text.</p>

<hr>

2.6.1: HTML Line Breaks

The HTML <br> element defines a line break.

Use <br> if you want a line break (a new line) without starting a new paragraph:

Example:

<p>This is<br>a paragraph with line breaks.</p>

Output: This is

a paragraph with line break.

2.7.1:HTML Styles

The HTML style attribute is used to add styles to an element, such as color, font, size, and more.

Example
:
I am Red
I am Blue

I am Big
Syntax: <tagname style="property:value;">

# HTML Fonts
The CSS font-family property defines the font to be used for an HTML element:
Example:
<h1 style="font-family:Algerian;">This is a heading</h1>

Output: This is a heading

# HTML Colour
11
The CSS color property defines the text color for an HTML element:
Example:
<h1 style="color:blue;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
Output
:

This is a heading
This is a heading

# HTML Size
The CSS font-size property defines the text size for an HTML element:
Example:
<h1 style="font-size:160%;">This is a heading</h1>

Output: This is heading


2.8.1: HTML Comments
With comments you can place notifications and reminders in your HTML code:
Example:
<!-- This is a comment -->

<p>This is a paragraph.</p>

<!-- Remember to add more information here -->

2.9.1: HTML links-Hyperlinks

HTML links are hyperlinks. You can click on a link and jump to another document.

When you move the mouse over a link, the mouse arrow will turn into a little hand.

Syntax: <a href="url">link text</a>

Example:

<a href="https://www.google.com/">Visit google</a>

2.10.1: HTML Images


12
Images can improve the design and the appearance of a web page.

Syntax: <img src="Image address" alt="Alternate name">

Example:

<img src="pic_trulli.jpg" alt="Italian Trulli">

2.11.1 : HTML Lists

HTML lists allow web developers to group a set of related items in lists.

Example:

An unordered HTML list: An ordered HTML lists

 Item 1.Item
 Item 2.Item
 Item 3.Item
 Item 4.Item

2.12 : HTML Classes

The HTML class attribute is used to specify a class for an HTML element.

Multiple HTML elements can share the same class.

Example:

<h class=”headd ”>this is heading</h>

<h class=”headd ”>this is 2nd heading</h>

2.13 :HTML ids

The HTML id attribute is used to specify a unique id for an HTML element.

You cannot have more than one element with the same id in an HTML document.

Example:

<h id=”headd ”>this is heading</h>


13
2.14 : HTML TABLE

HTML tables allow web developers to arrange data into rows and columns.

Example:

<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</
table>

Output:

Company Contact Country


Alfreds Futterkiste Maria Anders Germany
Centro comercial Moctezuma Francisco Chang Mexico

2.15 :HTML Forms


An HTML form is used to collect user input. The user input is most often sent to a server for
processing.
Example:
First name:
Jaskirat

Last name:
Paras

14
2.15. : HTML Input Tags

The HTML <input> element is the most used form element.

An <input> element can be displayed in many ways, depending on the type attribute.

Example:
<input type=”text”>
<input type=”radio”>
<input type=”checkbox”>

Chapter 3: Introduction to CSS


3.0 : Introduction

 CSS stands for Cascading Style Sheets


 CSS describes how HTML elements are to be displayed on screen, paper, or in other media
 CSS saves a lot of work. It can control the layout
 External stylesheets are stored in CSS files

Example:

body {
background-color: lightblue;
}

15
h1{
color: white;
text-align: center;
}

p{
font-family: verdana;
font-size: 20px;
}

3.1.1 : CSS Selectors

CSS selectors are used to "find" (or select) the HTML elements you want to style.

We can divide CSS selectors into five categories:

 Simple selectors (select elements based on name, id, class)


 Combinator selectors (select elements based on a specific relationship between them)
 Pseudo-class selectors (select elements based on a certain state)
 Pseudo-elements selectors (select and style a part of an element)
 Attribute selectors (select elements based on an attribute or attribute value)

3.1.2 : CSS Id Selectos

The id selector uses the id attribute of an HTML element to select a specific element.

The id of an element is unique within a page, so the id selector is used to select one unique element!

To select an element with a specific id, write a hash (#) character, followed by the id of the element.

Example:

#para1 {
text-align: center;
color: red;
}

3.1.3 : CSS Class Selectors

The class selector selects HTML elements with a specific class attribute.

To select elements with a specific class, write a period (.) character, followed by the class name.

Example:

.center {
text-align: center;

16
color: red;
}

3.1.4 : CSS Universal Selectors

The universal selector (*) selects all HTML elements on the page.

Example:

*{
margin: 0px;
padding: 0px;
}

3.2.0: CSS Comments

Comments are used to explain the code, and may help when you edit the source code at a later date.

Comments are ignored by browsers.

A CSS comment is placed inside the <style> element, and starts with /* and ends with */:

Example:

p{
color: red; /* Set text color to red */
}

3.3.0 : CSS Background

The CSS background properties are used to add background effects for elements.

In these chapters, you will learn about the following CSS background properties:

 background-color
 background-image
 background-repeat
 background-attachment
 background-position
 background (shorthand property)

Example:
17
body {
background-color: lightblue;
}

3.4.0 : CSS Borders

The CSS border properties allow you to specify the style, width, and color of an element's border.

CSS Border Style:

The border style property specifies what kind of border to display.

The following values are allowed:

 dotted - Defines a dotted border


 dashed - Defines a dashed border
 solid - Defines a solid border
 double - Defines a double border
 groove - Defines a 3D grooved border. The effect depends on the border-color value
 ridge - Defines a 3D ridged border. The effect depends on the border-color value
 inset - Defines a 3D inset border. The effect depends on the border-color value
 outset - Defines a 3D outset border. The effect depends on the border-color value
 none - Defines no border
 hidden - Defines a hidden border

The border style property can have from one to four values (for the top border, right border, bottom border,
and the left border).

3.5.0 : CSS Margins

The CSS margin properties are used to create space around elements, outside of any defined borders.

With CSS, you have full control over the margins. There are properties for setting the margin for each
side of an element (top, right, bottom, and left).

CSS has properties for specifying the margin for each side of an element:

 margin-top
 margin-right
 margin-bottom
 margin-left

All the margin properties can have the following values:

18
 auto - the browser calculates the margin
 length - specifies a margin in px, pt, cm, etc.
 %- specifies a margin in % of the width of the containing element
 inherit - specifies that the margin should be inherited from the parent element

3.6.0 : CSS Padding

Padding is used to create space around an element's content, inside of any defined borders. The
CSS padding properties are used to generate space around an element's content, inside of any defined
borders.

With CSS, you have full control over the padding. There are properties for setting the padding for each
side of an element (top, right, bottom, and left).

CSS has properties for specifying the padding for each side of an element:

 padding-top
 padding-right
 padding-bottom
 padding-left

All the padding properties can have the following values:

 length - specifies a padding in px, pt, cm, etc.


 % - specifies a padding in % of the width of the containing element
 inherit - specifies that the padding should be inherited from the parent element

Example:

div {
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}

3.7.0 : CSS Height and Width

The height and width properties are used to set the height and width of an element.

The height and width properties do not include padding, borders, or margins. It sets the height/width of
the area inside the padding, border, and margin of the element.

19
# CSS height and width Values

The height and width properties may have the following values:

 auto - This is default. The browser calculates the height and width
 length - Defines the height/width in px, cm etc.
 % - Defines the height/width in percent of the containing block
 initial - Sets the height/width to its default value
 inherit - The height/width will be inherited from its parent

value example:

div {
height: 200px;
width: 50%;
background-color: powderblue;
}

with max-width

div {
max-width: 500px;
height: 100px;
background-color: powderblue;
}

20
Chapter 4: Bootstrap
4.0: Introduction to Bootstrap

It is an open-source and free CSS framework, which helps in directing a responsive device-friendly
mobile-first front-end web page development tool. Bootstrap includes the CSS (Cascading Style
Sheets), and an optional JavaScript supported design template (plug-ins) that deals with typography,
implementation of buttons, forms, and various other components user interface. This framework helps
in faster web development and supports developers in creating responsive web pages faster.

4.1.0 : Bootstrap Component

The bootstrap consists of three main files. These are:

 Bootstrap CSS: a CSS framework.


 Bootstrap js: a JavaScript / jQuery framework.
 glyphicons: a font (an icon font set).

Also, Bootstrap needs jQuery for functioning. jQuery is an exceptionally admired and commonly used
JavaScript library which simplifies the cross-browser compatible functionality.

4.2.0: Link for using Bootstrap

Link= <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"


rel="stylesheet" integrity="sha384-
EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous">

Example:

<form action="/html/tags/html_form_tag_action.cfm">

<div class="form-group">

<label for="first_name">First Name</label>

<input type="text" class="form-control" id="first_name" name="first_name">

</div>
21
<div class="form-group">

<label for="last_name">Last Name</label>

<input type="text" class="form-control" id="last_name" name="last_name">

</div>

<button type="submit" class="btn btn-default">Submit</button>

</form>

Chapter 5: JAVA SCRIPT

5.0.1 : INTRODUCTION

JavaScript is the world's most popular programming language.

JavaScript is the programming language of the Web.

JavaScript is easy to learn.

This tutorial will teach you JavaScript from basic to advanced.

Syntax:

// How to create variables:


var x;
let y;

// How to use variables:


x = 5;
y = 6;
let z = x + y;

=>The JavaScript syntax defines two types of values:

 Fixed values
 Variable values

Fixed values are called Literals.

Variable values are called Variables.

22
5.1.0: Javascript Variables
4 Ways to Declare a JavaScript Variable:

 Using var
 Using let
 Using const
 Using nothing

Example of var:

var x = 5;
var y = 6;
var z = x + y;

5.2.0: Javascript If else


If statement
Use the if statement to specify a block of JavaScript code to be executed if a condition is true.

Syntax: if (condition) {
// block of code to be executed if the condition is true
}

Example
:
if (hour < 18) {
greeting = "Good day";
}

if else:

Use the else statement to specify a block of code to be executed if the condition is false.

Syntax: if (condition) {
// block of code to be executed if the condition is true
} else {
// block of code to be executed if the condition is false
}

Example:

if (hour < 18) {


23
} else {
greeting = "Good day";

24
greeting = "Good evening";
}

5.3.0 : Javascript Loops

Loops can execute a block of code a number of times.

JavaScript supports different kinds of loops:

 for - loops through a block of code a number of times


 for/in - loops through the properties of an object
 for/of - loops through the values of an iterable object
 while - loops through a block of code while a specified condition is true
 do/while - also loops through a block of code while a specified condition is true

for loop:

The for loop has the following syntax:

for (statement 1; statement 2; statement 3) {


// code block to be executed
}

example:

for (let i = 0; i < 5; i++) {


text += "The number is " + i + "<br>";
}

While loop:

The while loop loops through a block of code as long as a specified condition is true.

Syntax: while (condition) {


// code block to be executed
}

Example:

while (i < 10) {


text += "The number is " + i;
i++;
}

25
5.4.0: Functions

A JavaScript function is a block of code designed to perform a particular task.

A JavaScript function is executed when "something" invokes it (calls it).

Syntax:

function name(parameter1, parameter2, parameter3) {


// code to be executed
}

Example:

function myFunction(p1, p2) {


return p1 * p2; // The function returns the product of p1 and p2
}

5.5.0 : Javascript Arrays

JavaScript array is an object that represents a collection of similar type of elements.

There are 3 ways to construct array in JavaScript

1. By array literal
2. By creating instance of Array directly (using new keyword)
3. By using an Array constructor (using new keyword)

Syntax:

var arrayname=[value1,value2.. . .valueN];

Example
: <script>
var emp=["Sonoo","Vimal","Ratan"];

for (i=0;i<emp.length;i++)
{
document.write(emp[i] + "<br/>");
}
</script>

26
Chapter 6: PHP
6.0 : Introduction

 PHP is an acronym for "PHP: Hypertext Preprocessor"


 PHP is a widely-used, open source scripting language
 PHP scripts are executed on the server
 PHP is free to download and use
 PHP files can contain text, HTML, CSS, JavaScript, and PHP code
 PHP code is executed on the server, and the result is returned to the browser as plain HTML
 PHP files have extension ".php"
 PHP can generate dynamic page content
 PHP can create, open, read, write, delete, and close files on the server
 PHP can collect form data
 PHP can send and receive cookies
 PHP can add, delete, modify data in your database
 PHP can be used to control user-access
 PHP can encrypt data

6.1.0 : PHP Variables

In PHP, a variable starts with the $ sign, followed by the name of the variable:

Rules for PHP variables:

 A variable starts with the $ sign, followed by the name of the variable
 A variable name must start with a letter or the underscore character
 A variable name cannot start with a number
 A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
 Variable names are case-sensitive ($age and $AGE are two different variables)

Example:

27
<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;
?>

6.2.0: PHP Echo And Print

echo and print are more or less the same. They are both used to output data to the screen.

The differences are small: echo has no return value while print has a return value of 1 so it can be used
in expressions. echo can take multiple parameters (although such usage is rare) while print can take one
argument. echo is marginally faster than print.

Example:

Echo statement:

<?php
echo "<h2>PHP is Fun!</h2>";
echo "Hello world!<br>";
echo "I'm about to learn PHP!<br>";
echo "This ", "string ", "was ", "made ", "with multiple parameters.";
?>

Print statement:

<?php
print "<h2>PHP is Fun!</h2>";
print "Hello world!<br>";
print "I'm about to learn PHP!";
?>

6.3.0 : PHP Data Types

Variables can store data of different types, and different data types can do different things.

PHP supports the following data types:

 String
 Integer
 Float (floating point numbers - also called double)
28
 Boolean
 Array
 Object
 NULL
 Resource

Example:

<?php
$x = 5985;

$y=” Hello World”;


var_dump($x);

echo $y;
?>

6.4.0 : PHP if else

In PHP we have the following conditional statements:

 if statement - executes some code if one condition is true


 if...else statement - executes some code if a condition is true and another code if that condition
is false
 if...elseif...else statement - executes different codes for more than two conditions
 switch statement - selects one of many blocks of code to be executed

PHP if Statement

Syntax: If (condition) {
code to be executed if condition is true;
}

Example:

<?php
$t = date("H");

if ($t < "20") {


echo "Have a good day!";
}
?>

29
PHP if else Statement

The if...else statement executes some code if a condition is true and another code if that condition is
false.

Syntax: if (condition) {
code to be executed if condition is true;
} else {
code to be executed if condition is false;
}

Example:

<?php
$t = date("H");

if ($t < "20")


{ echo "Have a good day!";
} else {
echo "Have a good night!";
}
?>

PHP if elseif else Statement

The if...elseif...else statement executes different codes for more than two conditions.

Syntax: if (condition) {
code to be executed if this condition is true;
} elseif (condition) {
code to be executed if first condition is false and this condition is true;
} else {
code to be executed if all conditions are false;
}

Example:

<?php
$t = date("H");

if ($t < "10") {


echo "Have a good morning!";
} elseif ($t < "20") {
echo "Have a good day!";
} else {
echo "Have a good night!";
} ?>

29
6.5.0 :PHP Loops

Loops are used to execute the same block of code again and again, as long as a certain condition is true

In PHP, we have the following loop types:

 while - loops through a block of code as long as the specified condition is true
 do...while - loops through a block of code once, and then repeats the loop as long as the
specified condition is true
 for - loops through a block of code a specified number of times
 foreach - loops through a block of code for each element in an array

6.5.1 :While loop

The while loop - Loops through a block of code as long as the specified condition is true.

Syntax: while (condition is true) {


code to be executed;
}

Example:

<?php
$x = 1;

while($x <= 5)
{ echo "The number is: $x <br>";
$x++;
}
?>

6.5.2 : for loop

The for loop - Loops through a block of code a specified number of times.

Syntax: for (init counter; test counter; increment counter)

{
code to be executed for each iteration;
}

Example:

<?php
for ($x = 0; $x <= 10; $x++)

30
{
echo "The number is: $x <br>";
}
?>

6.5.3 : foreach loop


The foreach loop - Loops through a block of code for each element in an array

Syntax: foreach ($array as $value) {


code to be executed;
}

Example: <?php
$colors = array("red", "green", "blue", "yellow");

foreach ($colors as $value)


{ echo "$value <br>";
}
?>

6.6.0 : PHP Functions

PHP has over 1000 built-in functions that can be called directly, from within a script, to perform a
specific task.

Besides the built-in PHP functions, it is possible to create your own functions.

 A function is a block of statements that can be used repeatedly in a program.


 A function will not execute automatically when a page loads.
 A function will be executed by a call to the function.

Syntax: function functionName() {


code to be executed;
}

Example:

<?php
function writeMsg() {
echo "Hello world!";
}

writeMsg(); // call the function


?>

31
6.7.0 :PHP Arrays

An array stores multiple values in one single

variable: Syntax: array();

In PHP, there are three types of arrays:

 Indexed arrays - Arrays with a numeric index


 Associative arrays - Arrays with named keys
 Multidimensional arrays - Arrays containing one or more arrays

Example:

<?php
$cars = array("Volvo", "BMW", "Toyota");
echo count($cars);
?>

6.8.0 : PHP MYSQL Database

 MySQL is a database system used on the web


 MySQL is a database system that runs on a server
 MySQL is ideal for both small and large applications
 MySQL is very fast, reliable, and easy to use
 MySQL uses standard SQL
 MySQL compiles on a number of platforms
 MySQL is free to download and use
 MySQL is developed, distributed, and supported by Oracle Corporation
 MySQL is named after co-founder Monty Widenius's daughter: My

The data in a MySQL database are stored in tables. A table is a collection of related data, and it
consists of columns and rows.

6.8.1 : MYSQL Connect

<?php
$servername = "localhost";
$username = "username";
$password = "password";

// Create connection
32
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>

6.8.2 : MYSQL Creating and Inserting in Database

// Create database
$sql = "CREATE DATABASE myDB";
if ($conn->query($sql) === TRUE)
{ echo "Database created
successfully";
} else {
echo "Error creating database: " . $conn->error;
}

// Inserting into database

$sql = "INSERT INTO MyGuests (firstname, lastname, email)


VALUES ('Jaskirat', 'Singh', 'jaskirat@example.com')";

if ($conn->query($sql) === TRUE)


{ echo "New record created
successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}

Chapter 7:- Web Devlopment Project

7.1.1 Introduction
I am working on a SUBJECT NOTES project.

33
This project is very beneficial if anyone wants to go in website
development field .The Programming language that we used in this project is follows:

34
*HTML
*CSS
*BOOTSTRAP

7.1.2 : Tools for project

The tools that we given in this project is as follows:-

• Title Name
• About US
• Contact
• Profile
• Courses
• Competitive
• Upload
• Logo in

7.1.3: Steps for Creating project and Database

1. Create a folder name project in vscode of in ‘Project’ in xampp folder


2. Used the folder in vscode
3. Created home page using HTML
4. Used CSS to decorate it.
5. Created a login page
6. Now create courses page
7. Now created a competitive and upload page
8. Created a About us and contact page
9. Now Courses is divided into four section which is 11th/12th courses , B.Tech courses ,
M.Tech courses and Medical courses
10. Now these 4 courses are further divide into subjects and each subject has its separate page
11. Now created admin panel and user panel

Chapter 8:- Results And Discussuion


35
Result:
Finally applying many operations and many programming language this project has been
completed.
This project(Subject Notes)include many pages through which any number of traffic can come
ade can do their operation according to their requirements.

I think the test did went smoothly and I had no problems,except for the fact that the some
operations that I could not do .
Therefore, I had to take the sorry quickly

Discussion:

This site is used for searching study material which can be used for competitive exams like Jee ,
Gate, etc . It can also be used for college student or school students for their exams as we have
every study material you need . WE also provide very easily understandable material and if you
think you have more easy and understandable material than us then u can send or upload your
notes or material in our site , we will examine your notes and if we see if they are correct without
any problem and easily understandable than us then we will upload your notes or material on our
website . We hope you all will fell better using this site and help us recommend to others .

Chapter 9:- Conclusion and future Scope

36
Conclusion:
During making of this project I learned so many things. This project is completed on VS code
using Frontend Languages like ,HTML ,CSS, Javascript . One of the most beneficial work of this
site is that it helps student find study material for their college or school studies .

37

You might also like