Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
 
How does PHP work?

From Learning to Program in PHP and PHP Programming - presented this week, and repeating at regular intervals - see schedule.

Let's say that I want a web page - with a single URL (Uniform Resource Locator / name) - to show up differently in my browser depending on how I run it ...
• I write the text that's to appear on the page into a text file
• I add HTML (Hypertext Markup Language) tags - extra bits of information enclosed in < through to > characters - which indicate what's to be headlines, what's to be italics, etc.
• I add further tags which include program elements that are to run before the data is displayed, enclosed in <?php through to ?> character sets and within those tags I write in the PHP programming language.
Then ..
• I store the text file on my web server computer, in an appropriate place for the web server software (most commonly the Apache httpd server) to locate it when the appopriate URL is used by a client (that's your browser, or an automated program such as the Google indexing robot) to find it.
• I configure my server to run the program elements enclosed in the <?php through to ?> character sets (this is often a once-only job telling the server that anything ending in .php is to be handled that way.

Then when someone calls up my file via its URL ...
• The SERVER relpaces the <?php through to ?> sets with the result of running that code and passes it on (across the internet) to
• the CLIENT which follows the instructions in the remaining < through to > character blocks as regards formatting and
• displays the untagged (unblocked) text.


Translation within PHP to HTML - telling you the day of the weekEach of these stages can be seen / viewed if you wish to do so. In this screen capture, the original file as stored on the web server is seen at the bottom of the diagram. Above it (and to the right) is the text stream that's outputbythe web server and passed to the browser - we can see this by using the "view source" button on our browser (most browsers and do this). And in the top left of the screen capture is what the user sees through his / her browser.


That's a straightforeard example of the mechanism of PHP ... all I've done is to insert the day of the week into this particular page. But just think how much more I can do as I read forms from the user to control what gets sent out, access databases on the server, and even call up other web sites from within my PHP ...
(written 2012-11-07, updated 2012-11-10)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
H102 - A First PHP Web Page
  [4074] A comment on comments in PHP - (2013-04-28)
  [2432] Using print_r in PHP to explore mysql database requests - (2009-10-01)
  [1448] Question on division (Java) - Also Perl, PHP, Python ... - (2007-11-28)
  [624] It's REALLY easy to add a little PHP - (2006-02-26)

W603 - Web and Intranet - Server Side Technologies
  [4277] Sending a message to the server and changing text on a page when a button is pressed - (2014-05-23)
  [3705] Django Training Courses - UK - (2012-04-23)
  [2282] Checking robots.txt from Python - (2009-07-12)
  [2055] Effect on server when memory runs out and swapping starts - (2009-02-26)
  [1749] Using server side and client side programming together - (2008-08-11)
  [1615] PHP training courses every month - (2008-04-18)
  [1554] Online hotel reservations - Melksham, Wiltshire (near Bath) - (2008-02-24)
  [1365] Korn Shell scripts on the web - (2007-09-25)
  [1355] .php or .html extension? Morally Static Pages - (2007-09-17)
  [1031] robots.txt - a clue to hidden pages? - (2007-01-13)
  [1020] Parallel processing in PHP - (2007-01-03)
  [732] Where is a web site visitor browsing from - (2006-05-24)
  [653] Easy feed! - (2006-03-21)
  [642] How similar are two words - (2006-03-11)


Back to
While, for, foreach or something else to loop.
Previous and next
or
Horse's mouth home
Forward to
PHP variables - dynamically typed. What does that mean?
Some other Articles
What is a web framework?
Multiple page web applications - maintaining state - PHP
BODMAS - the order a computer evaluates arithmetic expressions
PHP variables - dynamically typed. What does that mean?
How does PHP work?
While, for, foreach or something else to loop.
How many times ... has this loco headed west through Tenby? - Python exceptions
Sand to Arabia, Coals to Newcastle or Woodburners to Russia
How well do you know Perl and / or Python?
Identifying your real customers and keeping them well informed fast
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2019: 404 The Spa • Melksham, Wiltshire • United Kingdom • SN12 6QL
PH: 01225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/3915_How ... work-.html • PAGE BUILT: Sat May 27 16:49:10 2017 • BUILD SYSTEM: WomanWithCat