php

22
SEMINAR ON SUMMER INDUSTRIAL TRAINING on Web Programming using PHP Saket Shukla 11004089 B.Tech. (honors) - CSE

Upload: saket-shukla

Post on 14-Nov-2014

510 views

Category:

Education


0 download

DESCRIPTION

Summer Training Report

TRANSCRIPT

Page 1: Php

SEMINAR ON SUMMER INDUSTRIAL TRAINING

onWeb Programming using PHP

Saket Shukla11004089B.Tech. (honors) - CSE

Page 2: Php

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 businesses, and social network services. Among web professionals, "web development" usually refers to the main non-design aspects of building web sites: writing mark up and coding.

Page 3: Php

HTML

HTML stands for Hypertext Markup Language, which is the main programming structure for web pages and browser software. When browser software accesses an HTML file it understands how to parse the document according to the file's extension.(.html - .txt - .php - .xml - .pdf - .doc - etc... ). HTML provides us a means of laying out and structuring our web pages using paragraphs, images, lists, indents, boxes, tables, colors, padding, and many more data structuring methods common to most data processing systems.

Page 4: Php

Basic HTML TagsThe Main Elements of an HTML Document<DOCTYPE> : Communicates with software(validators, browser) accessing the page to help identify the HTML rules being followed inside the document.

<html> : Defines the beginning and end of an HTML document. It contains the <head>, <meta>, <title>, and <body>

<head> : Used to describe or modify the content in the document. The head element contains the <meta>, and <title> elements

<meta> : Used to describe the document with a description and keywords primarily.

Page 5: Php

Basic HTML Tags contd..

<title> : Displays a page title in the browser tab bars and bookmark lists. The title element should come directly after your <meta> tags in the document and also communicates to search engine indexing bots to some degree.<body> : Directly after the <head> element closes(</head>) we define our <body> element. This element contains everything that we want to display to the browser software. The body element can have attributes set in it to affect the entire document if the author so chooses.

Page 6: Php

Cascaded Style Sheets

CSS is an acronym for Cascading Style Sheets. CSS is used to separate presentation and style from document markup content. It works by targeting your web page elements. CSS can target and style native elements like your body tag or all <p> tags on the page. It can also be made to target specific individual page elements or a group of labeled elements, as long as you give those elements the appropriate class name or identifier.

CSS specifications and validation services are maintained by W3C.CSS stands for Cascading Style SheetsStyles define how to display HTML elementsStyles were added to HTML 4.0 to solve a problemExternal Style Sheets can save a lot of workExternal Style Sheets are stored in CSS files

Page 7: Php

Javascript

JavaScript (not to be confused with Java) is a scripting language that is widely used by many developers that focus on website and web applications creation.  What is JavaScript?JavaScript was designed to add interactivity to HTML pagesJavaScript is a scripting languageA scripting language is a lightweight programming languageJavaScript is usually embedded directly into HTML pagesJavaScript is an interpreted language (means that scripts execute without preliminary compilation)Everyone can use JavaScript without purchasing a license

Page 8: Php

WHY PHP?PHP runs on different platforms (Windows, Linux, UNIX, etc.)

PHP is compatible with almost all servers used today (Apache, IIS, etc.)

PHP is FREE to download from the official PHP resource: www.php.net

PHP is easy to learn and runs efficiently on the server side

Page 9: Php

Introduction PHP is a server scripting language, and is a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP stands 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, JavaScript code, and PHP code PHP code are executed on the server, and the result is returned to the browser as plain HTML

Page 10: Php

PHP files have a default file extension of ".php” PHP can generate dynamic page content PHP can create, open, read, write, 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 restrict users to access some pages on your website PHP can encrypt data PHP runs on different platforms (Windows, Linux, Unix, Mac OS X, etc.) PHP is compatible with almost all servers used today (Apache, IIS, etc.) PHP has support for a wide range of databases Download it from the official PHP resource: www.php.net PHP is easy to learn and runs efficiently on the server side

Page 11: Php

PHP Database : MySQL

MySQL is the most popular open-source database system.

MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to number of databases. 

MySQL is currently the world’s most popular and widely used open source database technology and data storage system. MySQL offers great reliability and ease of use. It is free, and comes with free documentation as well as thousands of programmers that share their code that relates to communicating with a MySQL database. The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements.

Page 12: Php

Connecting PHP to MYSQL

Before we can access data in a database, we must open a connection to the MySQL server.In PHP, this is done with the mysql_connect() function.Syntax : mysql_connect(host,username,password,dbname);

Parameter

Description

host Optional. Either a host name or an IP address

username Optional. The MySQL user name

password Optional. The password to log in with

dbname Optional. The default database to be used when performing queries

Page 13: Php

OTHER MYSQL commands

•Mysql_close() : used to close an opened connection to database

•Mysql_query() : sends the sql query through the specified connection string to database returns the result

•Mysql__fetch_array() : fetches result in an array from the returned value from the query

•Mysql_error() : returns current mysql error description

Page 14: Php

Reasons for choosing PHP

1. Easy to get started with2. Designed for the web3. Free to use4. Many successful websites run on PHP

Page 15: Php

PHP Drawbacks

•PHP is a scripting language so it is slow (compared to C or C++)

•PHP is a scripting language with dynamic typing so it may have more undiscovered errors at run-time than a staticly typed language such as Java, C++ or C#

•Because anyone can learn PHP there is a lot of bad code out there written in PHP by poor programmers

•PHP is an ugly/messy/uncool procedural language

Page 16: Php

Project Implementation

The mini - project designed using this language is a basic city police website, which targets to provide with services to citizen at the comfort of their home.

The website apart from providing a landing page for the city police, provides people with options to locate their nearest police station.

The major service offered includes : lodging and receiving status of complaints

Page 17: Php
Page 18: Php
Page 19: Php
Page 20: Php
Page 21: Php
Page 22: Php

FUTURE ADVANCEMENTS for CURRENT PROJECT

•Usage of ajax for reducing load time and enhanced user experience

•Usage of xml for sending large amounts of data and images

•Increasing the number of services provided

•Inclusion of a CMS for the admin to control the website

•Inclusion of various other services and portals