Tech Talk: PHP - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Tech Talk: PHP

Description:

Open Source, free server-side HTML-embedded scripting language ... Anything you'd use a shell script or perl script to do! Variables of use: $argc, $argv ... – PowerPoint PPT presentation

Number of Views:74
Avg rating:3.0/5.0
Slides: 19
Provided by: prad159
Category:
Tags: php | talk | tech

less

Transcript and Presenter's Notes

Title: Tech Talk: PHP


1
Tech Talk PHP
  • Pradeep Tallogu
  • Deepak Avanna
  • Sharath Madathil

2
Overview
  • What is PHP ?
  • Server-side scripting
  • Command line scripting
  • Client side GUI applications
  • Comparison with other similar technologies
  • Advantages
  • Disadvantages
  • Conclusion

3
Personal Home Page (PHP)
  • Development started in 1994, by Rasmus Lerdorf.
  • A project of the Apache Software Foundation
  • http//www.php.net
  • Open Source, free server-side HTML-embedded
    scripting language
  • Cross-platform, suitable for today's
    heterogeneous network environments
  • PHP's syntax resembles C and Perl and is easy to
    learn for any programmer with C or Perl
    background
  • Simpler and faster to develop in (than C and
    Perl)

4
What is PHP?
  • PHP is mainly focused on server-side scripting,
    so you can do anything any other CGI program can
    do, such as collect form data, generate dynamic
    page content, or send and receive cookies.

5
Where does PHP fit ?
Page
HTTP
Request
Internet or
Web
Intranet
Web Browser
Web
page
page
Server-sideDynamic pages CGI, SSI, Server API,
ASP, JSP, PHP, COM/DCOM, CORBA
Client-sideActive pages JavaScript, VBScript,
Applet, ActiveX
Active and dynamic page technology can be used
together server-side program generates
customized active pages.
6
Server-side execution using PHP Script
Web-Client
Web-Server
HTML-Form
Call PHP interpreter
WWW
Submit Form Data
PHP Script
Web-Browser
Response
Response
Reply
7
Putting it all together
Web-Client
Database Server
Web-Server
HTML-Form (JavaScript)
Call PHP interpreter
WWW
DBMS
Submit Data
LAN
PHP Script
Web-Browser
SQL commands
Response
Response
Database Output
Reply
8
What more
  • Server-side scripting
  • Command-line scripting
  • Writing client side GUI applications

9
Command Line PHP
  • What is this good for
  • Parsing files to put into a database
  • Ideal for scripts regularly executed using cron
    (on nix or Linux) or Task Scheduler (on
    Windows).
  • Anything youd use a shell script or perl script
    to do!
  • Variables of use
  • argc, argv
  • stdin, stdout, stderr

10
Client side GUI applications
  • PHP-GTK
  • Cross platform GUI applications
  • Screen-shot of GUI created by PHP-GTK

11
Code for the screenshot
// Add a GtkEntry class to our window entry
new GtkEntry() entry-gtset_text("Hello
World") box-gtpack_start(entry)// Add a
GtkButton class to our window button new
GtkButton("Reverse Text") button-gtconnect("cli
cked", "reverseText", entry) box-gtpack_start(
button)function reverseText(theButton,
theEntry) text strrev(theEntry-gtget_tex
t()) theEntry-gtset_text(text) // Show
the window window-gtshow_all()// Start the
main PHP-GTK listener loop gtkmain()?gt
  • lt?php// Load the PHP-GTK extension extension
    "php_gtk" . (strpos(PHP_OS, "WIN") gt 0 ?
    ".dll" ".so") dl(extension)// Create a
    new window window new GtkWindow()
    window-gtset_title("Test App")
    window-gtset_usize(300, 50) window-gtset_posi
    tion(GTK_WIN_POS_CENTER) window-gtset_policy(fa
    lse, false, false)// Set a callback function
    for the destroy signal window-gtconnect("destroy
    ", "killwin")function killwin()
    echo("Window Destroyed!\n") gtkmain_quit()
    // Add a GtkVBox class to our window box
    new GtkVBox() window-gtadd(box)

12
PHP vs. JSP
  • PHP is faster in execution time
  • A recent survey in ZDnet's eWeek online
    publication found that PHP is as much as 3.5
    times faster than JSP
  • Faster in development time flatter learning
    curve
  • PHP supports any 32-bit or better platform,
    whereas JSP supports only platforms that have a
    Java virtual machine available

13
PHP vs. ASP
  • PHP is faster
  • Superior Memory Management
  • Closer to C Style of Programming
  • Cross Platform Migration Strategy
  • Dynamic generation of UI is more flexible

14
Benchmark
The following is a benchmark, where a Select
statement is executed 40 times on Microsoft SQL
Server 7 using PHP's MSSQL7 extension, PHP's ODBC
extension and COM
PHP Querying MSSQL7 Seconds (lower is better)
Using MSSQL extension 01.88
Using ODBC extension 09.54
Using ODBC via COM (ADO) 17.28
Using OLEDB via COM 6.19
15
Advantages of PHP
  • Light-weight
  • Cross-platform compatible
  • Procedural / Object Oriented programming
  • Supports wide range of Databases
  • Supports wide variety of outputs
  • Supports wide variety of protocols
  • Extremely useful text processing features
  • Open source

16
Disadvantages of PHP
  • Misperception on lack of Support.
  • Lack of IDE (Integrated Development Environment)
  • PHP has no formal error handling mechanisms.

17
Conclusion
18
References
  • www.php.net
  • www.webmonkey.com
  • www.phpworld.com
  • www.php.weblogs.com
Write a Comment
User Comments (0)
About PowerShow.com