SlideShare a Scribd company logo
PHP Web Development Rajib Ahmed
What we will see  “Today” Part 1 What is PHP? History of PHP Current Statistic of Apache PHP and MySQL Setting up the Working environment WAMP / LAMP / XAMP
Cont. Part 2 Our first Piece of  CODE PHP Variables Conditional Statement and Loops Arrays Functions Is PHP Object Orientated?
MySQL Part 3 MySQL The Brothers  PHP & MySQL Data Base Basics Our First Data Base  PhpMyAdmin Data retrieval by PHP
MBSTU.ac.bd Explained Part 4 What Is CMS? The Data base Two part View Some functions of mbstu.ac.bd Best of CMS
Advanced Topics Part 5 Frameworks Zend Frameworks Web 2.0 JavaScript AJAX DoJo/ JQuery ?
What is PHP? PHP stands for "PHP Hypertext Preprocessor” An embedded scripting language for HTML like ASP or JSP A language that combines elements of Perl, C, and Java
History of PHP Created by Rasmus Lerdorf in 1995 for tracking access to his resume Firstly Known as “Personal Home Page” Rewritten again in and released as version 2.0 in November of 1997
History of PHP User base in 1998 estimated 10,000 users and 100,000 web sites installed Version 3.0 was released in June 1998 as PHP Php Current version of release is 5.2.5 November 2007
Current Statistic  Performance* PHP pumped out about 47 pages/second  Microsoft ASP pumped out about 43 pages/second  Sun Java JSP pumped out about 13 pages/second
Setting up Working Environment  Manual Configuration Install Apache Install PHP Install MySQL Configure Apache
Config Apache C:\apacheXX\ \Httpd.conf\ LoadModule Php5_module C:/php5/sapi/php5apache.ddl AddType application/x-httpd-php .php .html
WAMP/ LAMP/ XAMP Preconfigured Package. WAMP => Windows Apache,MySQL and PHP Run The installer on Windows.
Bonus Text Editor Notepad Dream Weaver PHP Designer Eclipse
PART 2 Our first Piece of  CODE PHP Variables Conditional Statement and Loops Arrays Functions Is PHP Object Orientated?
Our first Piece of  CODE The Script Tags All PHP code is contained in one of several script tags: <? // Some code ?> <?php // Some code here ?>
The Hello World Example <?php   echo  “Hello world”; ?> Our first Piece of  CODE
Variables All variables starts with $  i.e  $var1 =“ Motiur Sir”   and $var2 =“ The Boss !!” How to print  “ Motiur Sir The Boss !!”
Exapmle The Hello World Example <?php   echo  $var1.$var2 ; ?> Output  “  Motiur Sir The Boss !!”
Conditional Statement  Conditional Statement If  (condition) // some code else
Conditional Statement Also elseif  (condition) Switch   (condition) Case XX : // Some codes break;
Arrays Very important Topic Declaring an array  $arrayExample=  array();   $arrayExample=  array( ‘ Nazrul Islam’, ‘ Is’,  ‘ COOL’ );
Built in Function : print_r() I use this function for Debugging print_r(  $arrayExample  ); Output: Array ( [0] => Nazrul Islam   [1] => Is    [2] => COOl!! )
Functions Two Types of Functions Built in Functions User defined functions
Built in Function Example bool  empty(); empty -- Determine whether a variable is empty  bool  isset(); isset -- Determine whether a variable is set . string  date(); date -- Format a local time/date
User Defined Functions Starts with keyword  function Our first function function  you_fail  ($name ) { echo   “ Sorry $name you have failed ” }
Is PHP Object Orientated? PHP is basically procedure oriented Scripting language PHP is object oriented from PHP 4.xx it had some limitations PHP‘s OOP support  is very good a PHP5
MySQL MySQL is a open source Database This year in February  Sun  Has bought MySQL It very popular in the WWW
The Brothers  PHP & MySQL There integration is great PHP has lots of built in functions MySQL PHP has built lots built in functions for other databases too. i.e. ORACLE, PostgreSQL, DB2
Database Basics Designing a database  Thinking about the relationship between data.
First Normal Form  First Normal Form  Each column in a row must be atomic. Each row in a table must contain the same number of columns. All rows in a table must be different.
Second Normal form The table must be in first normal form. All nonprimary key columns in the table must be dependent on the entire primary key. Why Normalization ?
Why Normalization ? Key point : Reducing data redundancies.
Our First Data Base Creating a  StudentInfo  database on MySQL Creating a Student table fields id stu_name stu_id stu_faculty stu_dept
Use PhpMyAdmin PhpMyAdmin is client program We will see the use  PhpMyAdmin
Data retrieval by PHP Step1: setting up -  user ,host, password Step2: connceting to mySQL Step3: selecting database selecting  studentInfo  database
Step1 define  ( host, &quot;localhost&quot;); define  ( user, &quot;root&quot;); define  ( pass, &quot;&quot;); define  ( DB, “studentInfo&quot;);
Step 2: $con =  mysql_connect  (  host ,user ,pass  ); if( ! $con) { echo &quot;Error in connection &quot;. mysql_error(); }
Step 3 $DB_sel=  mysql_select_db  ( DB , $con); if( ! $DB_sel ) { echo “Database Not Found &quot;. mysql_error(); }
Query $query_str =‘SELECT * FROM STUDETNS ’; $result = mysql_query ( $query_str );
Displaying Results while( $row =  mysql_fetch_array  ( $result ) ) { echo  $row[ ‘stu_name’ ].  ’\’s roll is’   .$row [ ‘stu_roll’   ] ; }
MBSTU.ac.bd Explained Part 4 The Data base Two part View Some functions of mbstu.ac.bd What Is CMS? Best of CMS
MBSTU.ac.bd
The Data base Database name  MBSTU Tables on DB faculty department menus page content news teachers teachers_designation results and more
Relation between tables
Two Part view This is used for repetitive parts on the HTML pages Header Footer Navigation
Header
Footer
Navigation
Some functions of mbstu.ac.bd function  get_all_faculty_name( ) function get_dept_name( ) function get_all_depertment_name( ) function get_page_content ( $page_id ) There is many more important and more complex functions
What is CMS CMS is Content Management System Where Content is modified without editing any HTML.  mbstu.ac.bd is a custom CMS
Joomla This is a open source CMS It is the new buzz word in PHP world By learning Joomla you can real good jobs Look BDJobs.com for that.
Advanced Topic Part 5 Frameworks Zend Frameworks Web 2.0 JavaScript AJAX DoJo/ JQuery ?
Frameworks Frameworks is abstractions layer for implementing common tasks. Frameworks implements “Design Patterns”
Zend Frameworks Zend is developed by Zeev Suraski and Andi Gutmans  This implements OOP Zend implements MVC ( Model, View, Controller ) This will be a great Frameworks for future
Ajax Ajax is Asynchronous JavaScript XML This is not a programming language Its term Defining Web 2.0 Ajax example Google suggest, Google Maps
DoJo / JQuery  This two JavaScript libraries are used for implementing Ajax.
Conclusion if you are planning a future in web development  HTML, CSS, PHP and Ajax will help you build one.
Thank you all for your patience

More Related Content

PPTX
PHP FUNCTIONS
PDF
Introduction to PHP
PPTX
working with PHP & DB's
PPT
PHP and MySQL
PPT
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PPTX
Introduction to php
PPT
Overview of PHP and MYSQL
PPT
PHP FUNCTIONS
Introduction to PHP
working with PHP & DB's
PHP and MySQL
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
Introduction to php
Overview of PHP and MYSQL

What's hot (20)

PPTX
Wt unit 5
PDF
Web develop in flask
PPTX
Introduction to PHP
PPTX
PHP Function
PPT
How to learn to build your own PHP framework
PPT
PHP Tutorials
PPTX
Loops PHP 04
PPT
Beginners PHP Tutorial
PDF
Php tutorial(w3schools)
PPT
What Is Php
 
PDF
&lt;img src="../i/r_14.png" />
ODP
PHP BASIC PRESENTATION
PDF
web2py:Web development like a boss
PPT
Chapter 02 php basic syntax
PDF
Introduction to php web programming - get and post
PPT
Php Presentation
PPT
PHP complete reference with database concepts for beginners
PPT
Class 6 - PHP Web Programming
DOCX
Php interview questions
Wt unit 5
Web develop in flask
Introduction to PHP
PHP Function
How to learn to build your own PHP framework
PHP Tutorials
Loops PHP 04
Beginners PHP Tutorial
Php tutorial(w3schools)
What Is Php
 
&lt;img src="../i/r_14.png" />
PHP BASIC PRESENTATION
web2py:Web development like a boss
Chapter 02 php basic syntax
Introduction to php web programming - get and post
Php Presentation
PHP complete reference with database concepts for beginners
Class 6 - PHP Web Programming
Php interview questions
Ad

Viewers also liked (20)

PDF
A Brief History of the Web
PPTX
Web Generartion
PPT
Web design history
PPTX
儿童互联网实验室 1.0版
PPS
Marapac
PDF
Group Concpet Mapping Learning Analytics @ LASI Amsterdam
PPT
MeshU Cloud Camp
PPT
Womens Day Of Learning
PPT
Corel
PDF
Cloud Computing Services And The Data Center
PPT
Fotos Amsterdam
PPT
Fsqparticsubat
PDF
Implementation of a Social Learning Platform to improve handovers in health
PPTX
Latvia anta school
PPT
Unit 1.3 Introduction to Programming (Part 2)
PPTX
中华民族的抗日战争
PPT
Product Development at the Smithsonian Libraries
PPT
Il cannocchiale aristotelico in viaggio per una mostra...
PDF
Enabling superior partner collaboration and consumer engagement.
PDF
Phoenix Az Dept Of Commerce Rural Renewable Presentations
A Brief History of the Web
Web Generartion
Web design history
儿童互联网实验室 1.0版
Marapac
Group Concpet Mapping Learning Analytics @ LASI Amsterdam
MeshU Cloud Camp
Womens Day Of Learning
Corel
Cloud Computing Services And The Data Center
Fotos Amsterdam
Fsqparticsubat
Implementation of a Social Learning Platform to improve handovers in health
Latvia anta school
Unit 1.3 Introduction to Programming (Part 2)
中华民族的抗日战争
Product Development at the Smithsonian Libraries
Il cannocchiale aristotelico in viaggio per una mostra...
Enabling superior partner collaboration and consumer engagement.
Phoenix Az Dept Of Commerce Rural Renewable Presentations
Ad

Similar to Starting with PHP and Web devepolment (20)

PDF
Current state-of-php
ODP
Exploring Symfony's Code
PPT
Php intro
PPT
Php intro
PPT
Php intro
PDF
PHP Basics
PPS
Simplify your professional web development with symfony
DOCX
Php interview questions
PDF
Php Interview Questions
PPT
An Introduction to Websphere sMash for PHP Programmers
PPT
Introduction To Code Igniter
PDF
Top 100 PHP Interview Questions and Answers
PPT
Phpwebdevelping
ODP
CodeIgniter PHP MVC Framework
PPT
Phpwebdev
PDF
PHP Unit-1 Introduction to PHP
PPT
Php classes in mumbai
PPTX
php basics
Current state-of-php
Exploring Symfony's Code
Php intro
Php intro
Php intro
PHP Basics
Simplify your professional web development with symfony
Php interview questions
Php Interview Questions
An Introduction to Websphere sMash for PHP Programmers
Introduction To Code Igniter
Top 100 PHP Interview Questions and Answers
Phpwebdevelping
CodeIgniter PHP MVC Framework
Phpwebdev
PHP Unit-1 Introduction to PHP
Php classes in mumbai
php basics

Recently uploaded (20)

PDF
01-Introduction-to-Information-Management.pdf
PPTX
Presentation on HIE in infants and its manifestations
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Classroom Observation Tools for Teachers
PDF
Supply Chain Operations Speaking Notes -ICLT Program
01-Introduction-to-Information-Management.pdf
Presentation on HIE in infants and its manifestations
human mycosis Human fungal infections are called human mycosis..pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Anesthesia in Laparoscopic Surgery in India
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Microbial disease of the cardiovascular and lymphatic systems
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Institutional Correction lecture only . . .
Chinmaya Tiranga quiz Grand Finale.pdf
Final Presentation General Medicine 03-08-2024.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
VCE English Exam - Section C Student Revision Booklet
STATICS OF THE RIGID BODIES Hibbelers.pdf
O7-L3 Supply Chain Operations - ICLT Program
Classroom Observation Tools for Teachers
Supply Chain Operations Speaking Notes -ICLT Program

Starting with PHP and Web devepolment

  • 1. PHP Web Development Rajib Ahmed
  • 2. What we will see “Today” Part 1 What is PHP? History of PHP Current Statistic of Apache PHP and MySQL Setting up the Working environment WAMP / LAMP / XAMP
  • 3. Cont. Part 2 Our first Piece of CODE PHP Variables Conditional Statement and Loops Arrays Functions Is PHP Object Orientated?
  • 4. MySQL Part 3 MySQL The Brothers PHP & MySQL Data Base Basics Our First Data Base PhpMyAdmin Data retrieval by PHP
  • 5. MBSTU.ac.bd Explained Part 4 What Is CMS? The Data base Two part View Some functions of mbstu.ac.bd Best of CMS
  • 6. Advanced Topics Part 5 Frameworks Zend Frameworks Web 2.0 JavaScript AJAX DoJo/ JQuery ?
  • 7. What is PHP? PHP stands for &quot;PHP Hypertext Preprocessor” An embedded scripting language for HTML like ASP or JSP A language that combines elements of Perl, C, and Java
  • 8. History of PHP Created by Rasmus Lerdorf in 1995 for tracking access to his resume Firstly Known as “Personal Home Page” Rewritten again in and released as version 2.0 in November of 1997
  • 9. History of PHP User base in 1998 estimated 10,000 users and 100,000 web sites installed Version 3.0 was released in June 1998 as PHP Php Current version of release is 5.2.5 November 2007
  • 10. Current Statistic Performance* PHP pumped out about 47 pages/second Microsoft ASP pumped out about 43 pages/second Sun Java JSP pumped out about 13 pages/second
  • 11. Setting up Working Environment Manual Configuration Install Apache Install PHP Install MySQL Configure Apache
  • 12. Config Apache C:\apacheXX\ \Httpd.conf\ LoadModule Php5_module C:/php5/sapi/php5apache.ddl AddType application/x-httpd-php .php .html
  • 13. WAMP/ LAMP/ XAMP Preconfigured Package. WAMP => Windows Apache,MySQL and PHP Run The installer on Windows.
  • 14. Bonus Text Editor Notepad Dream Weaver PHP Designer Eclipse
  • 15. PART 2 Our first Piece of CODE PHP Variables Conditional Statement and Loops Arrays Functions Is PHP Object Orientated?
  • 16. Our first Piece of CODE The Script Tags All PHP code is contained in one of several script tags: <? // Some code ?> <?php // Some code here ?>
  • 17. The Hello World Example <?php echo “Hello world”; ?> Our first Piece of CODE
  • 18. Variables All variables starts with $ i.e $var1 =“ Motiur Sir” and $var2 =“ The Boss !!” How to print “ Motiur Sir The Boss !!”
  • 19. Exapmle The Hello World Example <?php echo $var1.$var2 ; ?> Output “ Motiur Sir The Boss !!”
  • 20. Conditional Statement Conditional Statement If (condition) // some code else
  • 21. Conditional Statement Also elseif (condition) Switch (condition) Case XX : // Some codes break;
  • 22. Arrays Very important Topic Declaring an array $arrayExample= array(); $arrayExample= array( ‘ Nazrul Islam’, ‘ Is’, ‘ COOL’ );
  • 23. Built in Function : print_r() I use this function for Debugging print_r( $arrayExample ); Output: Array ( [0] => Nazrul Islam [1] => Is [2] => COOl!! )
  • 24. Functions Two Types of Functions Built in Functions User defined functions
  • 25. Built in Function Example bool empty(); empty -- Determine whether a variable is empty bool isset(); isset -- Determine whether a variable is set . string date(); date -- Format a local time/date
  • 26. User Defined Functions Starts with keyword function Our first function function you_fail ($name ) { echo “ Sorry $name you have failed ” }
  • 27. Is PHP Object Orientated? PHP is basically procedure oriented Scripting language PHP is object oriented from PHP 4.xx it had some limitations PHP‘s OOP support is very good a PHP5
  • 28. MySQL MySQL is a open source Database This year in February Sun Has bought MySQL It very popular in the WWW
  • 29. The Brothers PHP & MySQL There integration is great PHP has lots of built in functions MySQL PHP has built lots built in functions for other databases too. i.e. ORACLE, PostgreSQL, DB2
  • 30. Database Basics Designing a database Thinking about the relationship between data.
  • 31. First Normal Form First Normal Form Each column in a row must be atomic. Each row in a table must contain the same number of columns. All rows in a table must be different.
  • 32. Second Normal form The table must be in first normal form. All nonprimary key columns in the table must be dependent on the entire primary key. Why Normalization ?
  • 33. Why Normalization ? Key point : Reducing data redundancies.
  • 34. Our First Data Base Creating a StudentInfo database on MySQL Creating a Student table fields id stu_name stu_id stu_faculty stu_dept
  • 35. Use PhpMyAdmin PhpMyAdmin is client program We will see the use PhpMyAdmin
  • 36. Data retrieval by PHP Step1: setting up - user ,host, password Step2: connceting to mySQL Step3: selecting database selecting studentInfo database
  • 37. Step1 define ( host, &quot;localhost&quot;); define ( user, &quot;root&quot;); define ( pass, &quot;&quot;); define ( DB, “studentInfo&quot;);
  • 38. Step 2: $con = mysql_connect ( host ,user ,pass ); if( ! $con) { echo &quot;Error in connection &quot;. mysql_error(); }
  • 39. Step 3 $DB_sel= mysql_select_db ( DB , $con); if( ! $DB_sel ) { echo “Database Not Found &quot;. mysql_error(); }
  • 40. Query $query_str =‘SELECT * FROM STUDETNS ’; $result = mysql_query ( $query_str );
  • 41. Displaying Results while( $row = mysql_fetch_array ( $result ) ) { echo $row[ ‘stu_name’ ]. ’\’s roll is’ .$row [ ‘stu_roll’ ] ; }
  • 42. MBSTU.ac.bd Explained Part 4 The Data base Two part View Some functions of mbstu.ac.bd What Is CMS? Best of CMS
  • 44. The Data base Database name MBSTU Tables on DB faculty department menus page content news teachers teachers_designation results and more
  • 46. Two Part view This is used for repetitive parts on the HTML pages Header Footer Navigation
  • 50. Some functions of mbstu.ac.bd function get_all_faculty_name( ) function get_dept_name( ) function get_all_depertment_name( ) function get_page_content ( $page_id ) There is many more important and more complex functions
  • 51. What is CMS CMS is Content Management System Where Content is modified without editing any HTML. mbstu.ac.bd is a custom CMS
  • 52. Joomla This is a open source CMS It is the new buzz word in PHP world By learning Joomla you can real good jobs Look BDJobs.com for that.
  • 53. Advanced Topic Part 5 Frameworks Zend Frameworks Web 2.0 JavaScript AJAX DoJo/ JQuery ?
  • 54. Frameworks Frameworks is abstractions layer for implementing common tasks. Frameworks implements “Design Patterns”
  • 55. Zend Frameworks Zend is developed by Zeev Suraski and Andi Gutmans This implements OOP Zend implements MVC ( Model, View, Controller ) This will be a great Frameworks for future
  • 56. Ajax Ajax is Asynchronous JavaScript XML This is not a programming language Its term Defining Web 2.0 Ajax example Google suggest, Google Maps
  • 57. DoJo / JQuery This two JavaScript libraries are used for implementing Ajax.
  • 58. Conclusion if you are planning a future in web development HTML, CSS, PHP and Ajax will help you build one.
  • 59. Thank you all for your patience