Lec16_PHP_01.ppt
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,996
On Slideshare
1,996
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
23
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. CPE 595 Web Application Development PHP and MySQL Part 1
  • 2. What we have covered so far..
    • Basic HTML
    • Basic CSS
    • Basic JavaScript
    • Basic DHTML
    • Very Basic XML
  • 3. What We Will Cover Next …
    • Basic server-side programming
    • Basic web-oriented database development
    • Overview of ‘real world’ web application development techniques and issues
  • 4.
    • Web Application
    • Architectures
  • 5. Simplified Definition
    • A ‘web application’ uses the network as the underlying platform and typically uses a web browser on the client side
  • 6. Client - Server
    • Most web applications use a ‘client-server’ architecture. Clients (users) access application logic running on the server.
  • 7.
    • Within the general web application category there are many different technologies and approaches available for use.
    • Server-side programming languages: Java, ASP, Visual Basic, Perl, Ruby, PHP...
    • Server-side application platforms: Java Struts, Tomcat, Ruby on Rails, Zope, .NET, commercial offerings from vendors like IBM...
    • Databases: MySQL, MS-SQL, Oracle, Postgresql, Filemaker...
    • Client-side scripting languages: Javascript/DHTML, Ajax, Macromedia Flash or Director...
    • There’s often no one ‘correct’ way to design a web application, though some approaches will probably be more appropriate than others.
  • 8.
    • In this class
    • JavaScript/DHTML Ajax
    • PHP & MySQL
    • PHP for dynamic web page
    • creation, and MySQL
    • for basic database tasks
  • 9. Static Vs. Dynamic
    • The most basic web sites are ‘static’; they are composed of flat text HTML files living on a server
    • The client (browser) requests the file, and software on the server sends the unmodified file to the client. Easy, simple, and not really a ‘web application’.
  • 10. Static Transaction
    • User types ‘www.google.com’ into their browser
    • Browser looks up the domain name, then sends the request to the appropriate server
    • Software running on server loads the requested file and sends it back to the client
    • Client receives the file and displays it in the browser
  • 11. Static Transaction Components
    • Browser (Internet Explorer, Firefox, Safari) and operating system
    • DNS system, HTTP (Hypertext Transport Protocol)
    • Apache or IIS web server software, underlying server operating system
    • Browser rendering HTML
  • 12. Client Side Components
    • Web browsers are pieces of software that understand HTML markup language (among other things)
    • DNS is typically handled by the client operating system, connected to a DNS server, and resolves domain names to IP addresses
    • Browsers can use the operating system to send out HTTP requests
  • 13. Server Side Components
    • Servers usually run on more sophisticated versions of standard operating systems. Windows has a server version, OS X has a server version, and Linux is a full-fledged server operating system
    • Servers run web server applications such as Apache or Windows IIS. These applications take care of receiving client requests, finding the requested resources, and returning them to the clients (among other things)
  • 14. Limitations of Static Web Pages
    • Static web pages are a ‘one size fits all’ proposition. Everyone has access to the same set of pages.
    • Static would make for horrible online banking, ecommerce, web-based email...
  • 15. Adding dynamic processing
    • By adding application logic to the server, we’re able to customize our response to each client request
    • Allows us to have a ‘conversation’ with each client based on data sent by the client, data stored on the server, and information exchanged during the ‘conversation’
  • 16. And that’s where PHP comes in
    • PHP stands for “PHP: Hypertext Preprocessor”. (Yes, the name is recursive)
    • Allows us to add programming logic to our HTML pages, processed by our server application(s), that can produce custom HTML on demand.
  • 17. Understanding the stack Browsers (Internet Explorer, Firefox, Safari) only understand HTML and some other client-side technologies (Javascript, Flash) Servers, though, can run any number of applications capable of processing input and output
  • 18. What’s happening on the server
    • Incoming HTTP request is received by Apache
    • The HTTP request is for a PHP file
    • Apache loads the PHP file and runs it through the PHP parser (application running on the server)
    • The PHP application runs the PHP code and generates the output as directed by the PHP code within the HTML file
    • The completed HTML-only file is returned by Apache to the browser via HTTP
  • 19. A quick example Output after processing <html> <p>Hello there, ali </p> </html> File on server <html> <p>Hello there, <?php echo $USERNAME; ?> </p> </html> Don’t worry about the code, just remember that the PHP runs on the server and can create or modify the output displayed by the browser.
  • 20. Key things to remember
    • Client-side browsers do NOT understand server-side languages like PHP or .NET. They understand HTML. So the end output of almost all basic server-side web applications is going to be HTML.
    • We’re talking about a simple back and forth application design here; the client and server take turns driving the application. Other approaches, like AJAX, are more complex.
  • 21. Remember where the different technologies live Server side Software that can interact with multiple clients and can run your PHP program to allow customized ‘conversations’ with multiple clients Client side Browsers that can display HTML and can interact with different servers via HTTP This is a bit of an oversimplification (in fact, it really oversimplifies modern professional web application development practice, so don’t leave today thinking you’re suddenly an application design architect) but it’s good enough for us to go on for now.