SlideShare a Scribd company logo
Welcome to AJAX with LAMP Workshop Hussain Fakhruddin [email_address]
Overview of LAMP Introduction Client Server Model, What are web servers What is PHP? Why Use PHP? PHP Crash Course Language Reference: Variables, Controls, Loops etc.
Introduction
What is PHP PHP: Hypertext Preprocessor Why not HTP or HP or HPP? Recursive Acronym An acronym in which the first letter of the first word is represented by the acronym itself. GNU = “GNU is NOT UNIX” PHP: PHP Hypertext Preprocessor
Why Use PHP If you want to add dynamic content to your pages  If you want to make your pages easier to maintain If you’re learning your first "real" computing language  If you need a solution that’s portable across multiple platforms (e.g. Red Hat Linux to Windows 2000) If you like free software or need a free solution Examples of uses of PHP & MySQL: Sign-up Forms Surveys Polls Email a Postcard Content Management
What you need to start a website? What you need? Server PHP parser Configurations.
Some basic configurations Save all your file in Run from browser as http://localhost/  < FILENAME > Open any Text Editor and start coding
PHP Crash Course (cont.) Embedding PHP in HTML <html> <body> <strong>Hello World!</strong><br /> <?php echo ‘My name is HussuLinux!’; ?> </body> </html> PHP tag styles:   XML: <?php ?>, Short: <? ?>, ASP: <% %> Script: <script language=‘php’></script>
PHP Crash Course (cont.) Adding dynamic content by adding the date to the page. <html> <body> <strong>Hello World!</strong><br /> <? echo ‘Today is’; echo date(‘H:i jS F’); ?> </body> </html> Date()   http://www.php.net/manual/en/function.date.php PHP Function Reference  http://www.php.net/manual/en/funcref.php One useful function is phpinfo(). Gives system information so you can quickly find out what’s on your machine.
Using PHP to Query a  MySQL Database <html> <body> <h1>A List of Users Who Have Signed Up For OscarPool</h1> <? $dbh = mysql_connect(&quot;localhost&quot;,“dbusername&quot;,“dbpassword&quot;)   or  die(“Couldn't connect to database.&quot;); $db = mysql_select_db(“dbname&quot;, $dbh)    or  die(“Couldn't select database.&quot;); $sql = “SELECT username, email FROM oscarpool”; $result = mysql_query($sql, $dbh)  or  die(“Something is wrong with your SQL statement.&quot;); while ($row = mysql_fetch_array($result)) { $username = $row[‘username’]; $email = $row[‘email’]; echo ‘<a href=“mailto:’.$email.’”>’.$username.’</a><br />\n’; } ?> </body> </html>
AJAX
What's Ajax the buzzword Stands for Asynchronous JavaScript and XML Its a web development technique. Its Faster and Interactive.
Who uses Ajax? Gmail Google Maps Meebo Ebuddy And many more
Technology behind AJAX
Why Ajax? Faster, Increase Interactivity Rich User Experience
Steps to AJAX Create a  XMLHttpRequest  request object Tell the request object where to send the request Tell the object what to do when the request is answered Tell the object to make a request
Lets Code <script language = &quot;javascript&quot;> var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest (); }  else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject (&quot;Microsoft.XMLHTTP&quot;); } if (XMLHttpRequestObject) { document.write (&quot;<h1>Welcome to AJAX</h1>&quot;); } </script>
PHP & MySQL Resources Web Sites http://www.php.net/ http://www.phpbuilder.com/ http://www.devshed.com/ http://www.phpmyadmin.net/ http://www.hotscripts.com/PHP/ http://www.mysql.com/ http://www.owasp.org/ Books PHP and MySQL Web Development 2 nd  Edition, Welling & Thomson Web Database Applications with PHP & MySQL, O’Reilly Publishers PHP Cookbook, O’Reilly Publishers MySQL Cookbook, O’Reilly Publishers
My special Thanks to: David Olsen ( [email_address] ) for his help in presentation's content. PHP Freaks ( http://www.phpfreaks.com ) This is where I learnt PHP from

More Related Content

What's hot (20)

Introduction to Web Technology
Introduction to Web Technology
Rob Bertholf
 
Hosting
Hosting
Fajar Baskoro
 
HTTP
HTTP
Daniel Kummer
 
Web technologies: HTTP
Web technologies: HTTP
Piero Fraternali
 
Web Fundamental
Web Fundamental
SiliconExpert Technologies
 
What's up with HTTP?
What's up with HTTP?
Mark Nottingham
 
Get and post methods
Get and post methods
baabtra.com - No. 1 supplier of quality freshers
 
Web (HTTP) request to response life cycle
Web (HTTP) request to response life cycle
Gopakumar Kunduveetil
 
4 Basic PHP
4 Basic PHP
Jalpesh Vasa
 
Class 1 - World Wide Web Introduction
Class 1 - World Wide Web Introduction
Ahmed Swilam
 
Intro to Dynamic Web Pages
Intro to Dynamic Web Pages
Jussi Pohjolainen
 
Http
Http
NITT, KAMK
 
An Introduction to HTTP
An Introduction to HTTP
Keerthana Krishnan
 
HTTP
HTTP
vaibhavrai1993
 
Http request and http response
Http request and http response
Nuha Noor
 
KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7
phuphax
 
HTTP
HTTP
altaykarakus
 
Introduction About PHP
Introduction About PHP
Software company
 
Web Server-Side Programming Techniques
Web Server-Side Programming Techniques
guest8899ec02
 
Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014
Navaneethan Naveen
 

Similar to Linux Apache Php Mysql Lamp1273 (20)

Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Php intro
Php intro
Rajesh Jha
 
IT Club @ NCP - PHP Workshop May 10, 2011
IT Club @ NCP - PHP Workshop May 10, 2011
IT Club GTA
 
Introduction to javaScript
Introduction to javaScript
Neil Ghosh
 
Intro to-php-19 jun10
Intro to-php-19 jun10
Kathy Reid
 
Web development
Web development
Seerat Bakhtawar
 
Php
Php
Yuvaraja Rajenderan
 
Php
Php
merlin deepika
 
Php
Php
HAINIRMALRAJ
 
PHP Tutorials
PHP Tutorials
Yuriy Krapivko
 
PHP Tutorials
PHP Tutorials
Yuriy Krapivko
 
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Mahbubur Rahman
 
Ajax
Ajax
Pranay Rana
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
Justmeans power point
Justmeans power point
justmeanscsr
 
IT Club @ NCP - PHP Workshop May 10, 2011
IT Club @ NCP - PHP Workshop May 10, 2011
IT Club GTA
 
Introduction to javaScript
Introduction to javaScript
Neil Ghosh
 
Intro to-php-19 jun10
Intro to-php-19 jun10
Kathy Reid
 
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Mahbubur Rahman
 
Ad

More from hussulinux (7)

Effective communication
Effective communication
hussulinux
 
Enterprise Application Framework
Enterprise Application Framework
hussulinux
 
Direct Web Remoting : DWR
Direct Web Remoting : DWR
hussulinux
 
Auto Forex Trade with Meta Trader 4
Auto Forex Trade with Meta Trader 4
hussulinux
 
Apache Ant
Apache Ant
hussulinux
 
Mobile Navigation
Mobile Navigation
hussulinux
 
Flash Widget Tutorial
Flash Widget Tutorial
hussulinux
 
Effective communication
Effective communication
hussulinux
 
Enterprise Application Framework
Enterprise Application Framework
hussulinux
 
Direct Web Remoting : DWR
Direct Web Remoting : DWR
hussulinux
 
Auto Forex Trade with Meta Trader 4
Auto Forex Trade with Meta Trader 4
hussulinux
 
Mobile Navigation
Mobile Navigation
hussulinux
 
Flash Widget Tutorial
Flash Widget Tutorial
hussulinux
 
Ad

Recently uploaded (20)

FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 

Linux Apache Php Mysql Lamp1273

  • 1. Welcome to AJAX with LAMP Workshop Hussain Fakhruddin [email_address]
  • 2. Overview of LAMP Introduction Client Server Model, What are web servers What is PHP? Why Use PHP? PHP Crash Course Language Reference: Variables, Controls, Loops etc.
  • 4. What is PHP PHP: Hypertext Preprocessor Why not HTP or HP or HPP? Recursive Acronym An acronym in which the first letter of the first word is represented by the acronym itself. GNU = “GNU is NOT UNIX” PHP: PHP Hypertext Preprocessor
  • 5. Why Use PHP If you want to add dynamic content to your pages If you want to make your pages easier to maintain If you’re learning your first &quot;real&quot; computing language If you need a solution that’s portable across multiple platforms (e.g. Red Hat Linux to Windows 2000) If you like free software or need a free solution Examples of uses of PHP & MySQL: Sign-up Forms Surveys Polls Email a Postcard Content Management
  • 6. What you need to start a website? What you need? Server PHP parser Configurations.
  • 7. Some basic configurations Save all your file in Run from browser as http://localhost/ < FILENAME > Open any Text Editor and start coding
  • 8. PHP Crash Course (cont.) Embedding PHP in HTML <html> <body> <strong>Hello World!</strong><br /> <?php echo ‘My name is HussuLinux!’; ?> </body> </html> PHP tag styles: XML: <?php ?>, Short: <? ?>, ASP: <% %> Script: <script language=‘php’></script>
  • 9. PHP Crash Course (cont.) Adding dynamic content by adding the date to the page. <html> <body> <strong>Hello World!</strong><br /> <? echo ‘Today is’; echo date(‘H:i jS F’); ?> </body> </html> Date() http://www.php.net/manual/en/function.date.php PHP Function Reference http://www.php.net/manual/en/funcref.php One useful function is phpinfo(). Gives system information so you can quickly find out what’s on your machine.
  • 10. Using PHP to Query a MySQL Database <html> <body> <h1>A List of Users Who Have Signed Up For OscarPool</h1> <? $dbh = mysql_connect(&quot;localhost&quot;,“dbusername&quot;,“dbpassword&quot;) or die(“Couldn't connect to database.&quot;); $db = mysql_select_db(“dbname&quot;, $dbh) or die(“Couldn't select database.&quot;); $sql = “SELECT username, email FROM oscarpool”; $result = mysql_query($sql, $dbh) or die(“Something is wrong with your SQL statement.&quot;); while ($row = mysql_fetch_array($result)) { $username = $row[‘username’]; $email = $row[‘email’]; echo ‘<a href=“mailto:’.$email.’”>’.$username.’</a><br />\n’; } ?> </body> </html>
  • 11. AJAX
  • 12. What's Ajax the buzzword Stands for Asynchronous JavaScript and XML Its a web development technique. Its Faster and Interactive.
  • 13. Who uses Ajax? Gmail Google Maps Meebo Ebuddy And many more
  • 15. Why Ajax? Faster, Increase Interactivity Rich User Experience
  • 16. Steps to AJAX Create a XMLHttpRequest request object Tell the request object where to send the request Tell the object what to do when the request is answered Tell the object to make a request
  • 17. Lets Code <script language = &quot;javascript&quot;> var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest (); } else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject (&quot;Microsoft.XMLHTTP&quot;); } if (XMLHttpRequestObject) { document.write (&quot;<h1>Welcome to AJAX</h1>&quot;); } </script>
  • 18. PHP & MySQL Resources Web Sites http://www.php.net/ http://www.phpbuilder.com/ http://www.devshed.com/ http://www.phpmyadmin.net/ http://www.hotscripts.com/PHP/ http://www.mysql.com/ http://www.owasp.org/ Books PHP and MySQL Web Development 2 nd Edition, Welling & Thomson Web Database Applications with PHP & MySQL, O’Reilly Publishers PHP Cookbook, O’Reilly Publishers MySQL Cookbook, O’Reilly Publishers
  • 19. My special Thanks to: David Olsen ( [email_address] ) for his help in presentation's content. PHP Freaks ( http://www.phpfreaks.com ) This is where I learnt PHP from