A Seminar On Professional Web Development Using PHP Submitted To Department of Electronics and Communication ITM GIDA, Gorakhpur
A Seminar On Professional Web Development Using PHP Submitted To Department of Electronics and Communication ITM GIDA, Gorakhpur
Seminar on
Professional Web development using PHP
Submitted to
Department of Electronics and Communication
ITM GIDA, Gorakhpur
Presented by:-
Arihant Jain
Introduction to Web development
Web development is a broad term for the work involved in developing a web
site for the internet (World Wide Web) or an intranet (a private network). Web
development can range from developing the simplest static single page of plain
text to the most complex web-based internet applications, electronic business,
and social network services
Creating your Web site
• HTML stands for Hypertext Markup Language, and it is the most widely
used language to write Web Pages.
• Hypertext refers to the way in which Web pages (HTML documents) are
linked together. Thus, the link available on a webpage is called Hypertext.
• As its name suggests, HTML is a Markup Language which means you use
HTML to simply "mark-up" a text document with tags that tell a Web
browser how to structure it to display.
HTML Fundamentals :-
• Clear text, case insensitive.
• Ignores white space.
• Comprised of tags <tag />.
• Open tags and closed tags.
HTML Tags
• HTML Tags
• As told earlier, HTML is a markup language and makes use of various tags
to format the content. These tags are enclosed within angle braces
<Tag Name>.
• Except few tags, most of the tags have their corresponding closing tags.
For example, <html> has its closing tag</html> and <body> tag has its
closing tag </body> tag etc.
•
<Head> This tag represents the document's header like <title>, <link> etc.
<body> This tag represents the document's body which keeps other HTML
tags like <h1>, <div>, <p> etc.
<title> The <title> tag is used inside the <head> tag to mention the
document title.
• The name is the property you want to set. For example, the paragraph <p>
element in the example carries an attribute whose name is Style, which
you can use to design the element of paragraph on the page.
• The value is what you want the value of the property to be set and always
put within quotations. The below example shows three possible values of
style attribute: Size, family, color.
• The style Attribute –
• <!DOCTYPE html>
• <html>
• <head>
• <title>The style Attribute</title>
• </head>
• <body>
• <p style="color:#FF0000; font-family:verdana; font-size:40">
• this is paragraph.
• </p>
• <p style="color:green; font-family:verdana; font-size:40">
• this is paragraph.
• </p>
• </body>
• </html>
• This will produce the following result…..
CSS - OVERVIEW
What is CSS?
• Cascading Style Sheets, fondly referred to as CSS, is a simple design
language intended to simplify the process of making web pages
presentable.
• CSS handles the look and feel part of a web page. Using CSS, you can
control the color of the text, the style of fonts, the spacing between
paragraphs, how columns are sized and laid out, what background images
or colors are used, as well as a variety of other effects.
• CSS is easy to learn and understand but it provides a powerful control over
the presentation of an HTML document. Most commonly, CSS is combined
with the markup languages HTML or XHTML.
CSS - SYNTAX
• A CSS comprises of style rules that are interpreted by the browser and
then applied to the corresponding elements in your document. A style rule
is made of three parts:
• Selector: A selector is an HTML tag at which a style will be applied. This
could be any tag like <h1> or <table> etc.
• Property: A property is a type of attribute of HTML tag. Put simply, all the
HTML attributes are converted into CSS properties. They could be color,
border, etc.
• Value: Values are assigned to properties. For example, color property can
have the value either red or #F1F1F1 etc.
• You can put CSS Style Rule Syntax as follows:
• selector { property: value }
CSS-INCLUSION
• There are three ways to associate styles with your HTML document. Most
commonly used methods are inline CSS and External CSS.
Inline CSS - The style Attribute
• You can use style attribute of any HTML element to define style rules.
These rules will be applied to that element only. Here is the generic
syntax:
• <element style="...style rules....">
Example
• Following is the example of inline CSS based on the above syntax:
<h1 style ="color:red;"> This is inline CSS </h1>
This will produce following result..
• The if, elseif ...else and switch statements are used to take decision based
on the different condition.
• The If...Else Statement
• If you want to execute some code if a condition is true and another code if
a condition is false, use the if....else statement.
• Syntax
if (condition)
code to be executed if condition is true;
else
code to be executed if condition is false;
• Example
• The following example will output "Have a nice weekend!" if the current day
is Friday, otherwise it will output "Have a nice day!":
<html>
<body>
<?php
$d=date("D");
if ($d=="Fri")
echo "Have a nice weekend!";
else
echo "Have a nice day!";
?>
</body>
</html>
This will give the following result:
Have a nice day!
PHP FORMS
• The most important thing to notice when dealing with HTML forms and
PHP is that any form element in an HTML page will automatically be
available to your PHP scripts.
• The HTML <form> tag is used to create an HTML/PHP form and it has
following syntax:
• <form action="Script URL" method="GET|POST"> form elements like
input, textarea etc.
</form>
• Try out the following example :-
<?php
if(isset($_POST["submit"]))
{
echo "Welcome ".$_POST["name"]. "<br>";
echo "you are ".$_POST["age"]." year old and you are ".$_POST["gender"]."<br>";
• JavaScript made its first appearance in Netscape 2.0 in 1995 with a name
LiveScript.
• MySQL Database
• MySQL is a fast, easy-to-use RDBMS being used for many small and big
businesses. MySQL is developed, marketed and supported by MySQL AB,
which is a Swedish company. MySQL is becoming so popular because of
many good reasons:
• MySQL is released under an open-source license. So you have nothing to
pay to use it.
• MySQL is a very powerful program in its own right. It handles a large
subset of the functionality of the most expensive and powerful database
packages.
• MySQL uses a standard form of the well-known SQL data language.
• MySQL works on many operating systems and with many languages
including PHP PERL, C, C++, JAVA, etc.
Create Database
Syntax:
CREATE DATABASE database_name;
Example:
Let's take an example to create a database name "employees"
CREATE DATABASE employees;
Syntax:
Following is a generic syntax for creating a MySQL table in the database.