Professional Documents
Culture Documents
M.ElSherbiny90@yahoo.com
DAY 1
INTRODUCTION TO PHP
The Web server starts scanning the file in HTML mode. It assumes the statements are
HTML and sends them to the browser without any processing.
The Web server continues in HTML mode until it encounters a PHP opening tag (<?PHP).
When it encounters a PHP opening tag, the Web server switches to PHP mode. This is
sometimes called escaping from HTML. The Web server then assumes that all statements are
PHP statements and executes the PHP statements. If there is output, the server sends the
output to the browser.
The Web server continues in PHP mode until it encounters a PHP closing tag (?>).
When the Web server encounters a PHP closing tag, it returns to HTML mode. It resumes
scanning, and the cycle continues from Step 1.
The PHP interpreter processes the page, communicating with file systems,
databases, and email servers as necessary, and then delivers a web page to the web
server to return to the browser.
●
<?
Short style ●
// your code
●
?>
●
<script language="php">
Script style ●
// your code
●
</script>
All Rights Reserved © 2011 - Powered by
M.ElSherbiny90@yahoo.com 10
Mohamed El-Sherbiny
PHP Hello World Script
<? Php
?>
• Multiline comments
/*
Your multiline comments
Your multiline comments
*/
All Rights Reserved © 2011 - Powered by
M.ElSherbiny90@yahoo.com 12
Mohamed El-Sherbiny