SlideShare una empresa de Scribd logo
1 de 25
PHP for hacks
                  Souri Datta
      (sourind@yahoo-inc.com)
What is PHP?
• Server side language
• Very easy to learn
• Available on LAMP stack (Linux Apache Mysql
  PHP)
• Does not require any special tools. Create a file
  with .php extension and you are done.
What we need to learn (for hacks)?
•   Enough PHP to handle simple request
•   How to talk to backend data store using PHP
•   How to parse XML/JSON in PHP
•   How to generate JSON in PHP
Getting Started
• You need a local server with PHP enabled.
• XAMPP for windows and Mac OS
• Linux has it by default
Getting Started



       Create a file hello.php inside htdocs and open it in browserlike
       this http://localhost/hello.php
                 <?php
                  $school="iit-b";
                  echo "Hello, World $school";
                 ?>




demo1.php
Basics
• PHP blocks start with <?php and end with ?> -
• Every line of PHP has to end with a semicolon
  ";”
• Variables in PHP start with a $
• You print out content to the document in PHP
  with the echo command.
• $school is variable and it can be printed out
• You can jump in and out of PHP anywhere in the
  document. So if you intersperse PHP with HTML
  blocks, that is totally fine. For example:
Mix Match




            demo2.php
Displaying more complex data
• You can define arrays in PHP using the array()
  method
    $lampstack = array('Linux','Apache','MySQL','PHP');
• If you simply want to display a complex
  datatype like this in PHP for debugging you can
  use the print_r() command
   $lampstack = array('Linux','Apache','MySQL','PHP');
print_r($lampstack);
Arrays




         demo4.php
Arrays




sizeof($array) - this will return the size of the array




                                                          demo5.php
Associative Arrays

<ul>
<?php
$lampstack = array(
  'Operating System' => 'Linux',
  'Server' => 'Apache',
  'Database' => 'MySQL',
  'Language' => 'PHP'
);
$length = sizeof($lampstack);
$keys = array_keys($lampstack);
for( $i = 0;$i < $length;$i++ ){
  echo '<li>' . $keys[$i] . ':' . $lampstack[$keys[$i]] . '</li>';
}
?>
</ul>
Functions
<?php
function renderList($array){
  if( sizeof($array) > 0 ){
    echo '<ul>';
foreach( $array as $key => $item ){
      echo '<li>' . $key . ':' . $item . '</li>';
    }
    echo '</ul>';
  }
}
$lampstack = array(
  'Operating System' => 'Linux',
  'Server' => 'Apache',
  'Database' => 'MySQL',
  'Language' => 'PHP'
);
renderList($lampstack);
?>                                                  demo6.php
Interacting with the web - URL
                        parameters
<?php
$name = 'Tom';

// if there is no language defined, switch to English
if( !isset($_GET['language']) ){
  $welcome = 'Oh, hello there, ';
}
if( $_GET['language'] == 'hindi' ){
  $welcome = 'Namastae, ';
}
switch($_GET['font']){
  case 'small':
    $size = 80;
  break;
  case 'medium':
    $size = 100;
  break;
  case 'large':
    $size = 120;
  break;
  default:
    $size = 100;
  break;
}
echo '<style>body{font-size:' . $size . '%;}</style>';
echo '<h1>'.$welcome.$name.'</h1>';
?>


                                                         demo7.php
Loading content from the web

<?php
 // define the URL to load
 $url = 'http://cricket.yahoo.com/player-profile/Sachin-
Tendulkar_2962';
 // start cURL
 $ch = curl_init();
 // tell cURL what the URL is
curl_setopt($ch, CURLOPT_URL, $url);
 // tell cURL that you want the data back from that URL
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 // run cURL
 $output = curl_exec($ch);
 // end the cURL call (this also cleans up memory so it is
 // important)
curl_close($ch);
 // display the output
 echo $output;
?>




                                                             demo8.php
ParsingXML content
• Demo




demo9.php
ParsingJSON content
• Demo




demo9.php
Talking to Mysql db
Further Reference
         http://www.php.net/
     http://developer.yahoo.com
http://www.slideshare.net/souridatta
Nods.js
• A javascript runtime environment
• Javascript is used to write client side code, but
  with node.js, server side code can be written
• Runs over cmd line
Getting started
• Download nods.js and install it
  – http://nodejs.org/
• You are ready to go!
Hello World

Create a file hello.js




From cmd line , run : node hello.js

Open in browser : http://localhost:8888/
Advantages
• Event-driven asynchronous i/o




• Callbacks are attached to i/o
  – Avoids blocking
Further reading
• http://nodejs.org/
• http://www.nodebeginner.org/
• http://code.google.com/p/v8/
Thank you!

Más contenido relacionado

La actualidad más candente

PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.Binny V A
 
Php basic for vit university
Php basic for vit universityPhp basic for vit university
Php basic for vit universityMandakini Kumari
 
Class 6 - PHP Web Programming
Class 6 - PHP Web ProgrammingClass 6 - PHP Web Programming
Class 6 - PHP Web ProgrammingAhmed Swilam
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHPBradley Holt
 
Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04Spy Seat
 
Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHPShweta A
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPwahidullah mudaser
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboardsDenis Ristic
 
php $_GET / $_POST / $_SESSION
php  $_GET / $_POST / $_SESSIONphp  $_GET / $_POST / $_SESSION
php $_GET / $_POST / $_SESSIONtumetr1
 
What Is Php
What Is PhpWhat Is Php
What Is PhpAVC
 
Intro to php
Intro to phpIntro to php
Intro to phpSp Singh
 

La actualidad más candente (20)

Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Sa
SaSa
Sa
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 
Php basic for vit university
Php basic for vit universityPhp basic for vit university
Php basic for vit university
 
Class 6 - PHP Web Programming
Class 6 - PHP Web ProgrammingClass 6 - PHP Web Programming
Class 6 - PHP Web Programming
 
Php Lecture Notes
Php Lecture NotesPhp Lecture Notes
Php Lecture Notes
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04
 
PHP POWERPOINT SLIDES
PHP POWERPOINT SLIDESPHP POWERPOINT SLIDES
PHP POWERPOINT SLIDES
 
Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHP
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php with mysql ppt
Php with mysql pptPhp with mysql ppt
Php with mysql ppt
 
PHP5.5 is Here
PHP5.5 is HerePHP5.5 is Here
PHP5.5 is Here
 
Php security3895
Php security3895Php security3895
Php security3895
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
 
php $_GET / $_POST / $_SESSION
php  $_GET / $_POST / $_SESSIONphp  $_GET / $_POST / $_SESSION
php $_GET / $_POST / $_SESSION
 
Intermediate PHP
Intermediate PHPIntermediate PHP
Intermediate PHP
 
What Is Php
What Is PhpWhat Is Php
What Is Php
 
Intro to php
Intro to phpIntro to php
Intro to php
 

Similar a HackU PHP and Node.js

Similar a HackU PHP and Node.js (20)

WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Prersentation
PrersentationPrersentation
Prersentation
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentation
 
Php i basic chapter 3
Php i basic chapter 3Php i basic chapter 3
Php i basic chapter 3
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
 
Php with my sql
Php with my sqlPhp with my sql
Php with my sql
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Introducation to php for beginners
Introducation to php for beginners Introducation to php for beginners
Introducation to php for beginners
 
php 1
php 1php 1
php 1
 
Pecl Picks
Pecl PicksPecl Picks
Pecl Picks
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
 
Php
PhpPhp
Php
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
 
Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdfLecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdf
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
Intro to PHP
Intro to PHPIntro to PHP
Intro to PHP
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
 

Último

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Último (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

HackU PHP and Node.js

  • 1. PHP for hacks Souri Datta (sourind@yahoo-inc.com)
  • 2.
  • 3. What is PHP? • Server side language • Very easy to learn • Available on LAMP stack (Linux Apache Mysql PHP) • Does not require any special tools. Create a file with .php extension and you are done.
  • 4. What we need to learn (for hacks)? • Enough PHP to handle simple request • How to talk to backend data store using PHP • How to parse XML/JSON in PHP • How to generate JSON in PHP
  • 5. Getting Started • You need a local server with PHP enabled. • XAMPP for windows and Mac OS • Linux has it by default
  • 6. Getting Started Create a file hello.php inside htdocs and open it in browserlike this http://localhost/hello.php <?php $school="iit-b"; echo "Hello, World $school"; ?> demo1.php
  • 7. Basics • PHP blocks start with <?php and end with ?> - • Every line of PHP has to end with a semicolon ";” • Variables in PHP start with a $ • You print out content to the document in PHP with the echo command. • $school is variable and it can be printed out • You can jump in and out of PHP anywhere in the document. So if you intersperse PHP with HTML blocks, that is totally fine. For example:
  • 8. Mix Match demo2.php
  • 9. Displaying more complex data • You can define arrays in PHP using the array() method $lampstack = array('Linux','Apache','MySQL','PHP'); • If you simply want to display a complex datatype like this in PHP for debugging you can use the print_r() command $lampstack = array('Linux','Apache','MySQL','PHP'); print_r($lampstack);
  • 10. Arrays demo4.php
  • 11. Arrays sizeof($array) - this will return the size of the array demo5.php
  • 12. Associative Arrays <ul> <?php $lampstack = array( 'Operating System' => 'Linux', 'Server' => 'Apache', 'Database' => 'MySQL', 'Language' => 'PHP' ); $length = sizeof($lampstack); $keys = array_keys($lampstack); for( $i = 0;$i < $length;$i++ ){ echo '<li>' . $keys[$i] . ':' . $lampstack[$keys[$i]] . '</li>'; } ?> </ul>
  • 13. Functions <?php function renderList($array){ if( sizeof($array) > 0 ){ echo '<ul>'; foreach( $array as $key => $item ){ echo '<li>' . $key . ':' . $item . '</li>'; } echo '</ul>'; } } $lampstack = array( 'Operating System' => 'Linux', 'Server' => 'Apache', 'Database' => 'MySQL', 'Language' => 'PHP' ); renderList($lampstack); ?> demo6.php
  • 14. Interacting with the web - URL parameters <?php $name = 'Tom'; // if there is no language defined, switch to English if( !isset($_GET['language']) ){ $welcome = 'Oh, hello there, '; } if( $_GET['language'] == 'hindi' ){ $welcome = 'Namastae, '; } switch($_GET['font']){ case 'small': $size = 80; break; case 'medium': $size = 100; break; case 'large': $size = 120; break; default: $size = 100; break; } echo '<style>body{font-size:' . $size . '%;}</style>'; echo '<h1>'.$welcome.$name.'</h1>'; ?> demo7.php
  • 15. Loading content from the web <?php // define the URL to load $url = 'http://cricket.yahoo.com/player-profile/Sachin- Tendulkar_2962'; // start cURL $ch = curl_init(); // tell cURL what the URL is curl_setopt($ch, CURLOPT_URL, $url); // tell cURL that you want the data back from that URL curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // run cURL $output = curl_exec($ch); // end the cURL call (this also cleans up memory so it is // important) curl_close($ch); // display the output echo $output; ?> demo8.php
  • 19. Further Reference http://www.php.net/ http://developer.yahoo.com http://www.slideshare.net/souridatta
  • 20. Nods.js • A javascript runtime environment • Javascript is used to write client side code, but with node.js, server side code can be written • Runs over cmd line
  • 21. Getting started • Download nods.js and install it – http://nodejs.org/ • You are ready to go!
  • 22. Hello World Create a file hello.js From cmd line , run : node hello.js Open in browser : http://localhost:8888/
  • 23. Advantages • Event-driven asynchronous i/o • Callbacks are attached to i/o – Avoids blocking
  • 24. Further reading • http://nodejs.org/ • http://www.nodebeginner.org/ • http://code.google.com/p/v8/