Tuesday 4 August 2015

WebSite Designing Traning Session 1 Using Php

WebSite Designing Traning Session 1

 PHP Programming
What is PHP?
• PHP stands for PHP Hypertext Processor — A recursive
definition!!.
• PHP is a server-side scripting language that is embedded in
a web page or can be run as script  from the
command line


PHP Characteristics
The main characteristics of PHP are:
• PHP is web-specific and open source
• Scripts are embedded into static HTML files
• Fast execution of scripts
• Fast access to the database tier of applications
• Supported by most web servers and operating systems
• Supports many standard network protocols libraries available for IMAP, NNTP,
SMTP, POP3,
• Supports many database management systems libraries available for UNIX DBM,
MySQL, Oracle,
• Dynamic Output any text, HTML XHTML and any other XML file.
• Also Dynamic Output images, PDF files and even Flash movies
• Text processing features, from the POSIX Extended or Perl regular expressions
to parsing XML documents.
• A fully featured programming language suitable for complex systems
development

What can PHP do?
As we have just said PHP is a fully featured programming language
so it can do just about anything.
However it is best suited and 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,
• Send and receive cookies.

Three main uses of PHP
Server-side scripting —This is the most traditional and main target
field for PHP. You need three things to make this work:
• The PHP parser (CGI or server module),
• A web server —needs a connected PHP installation
• A web browser—access PHP page through URL
Command line scripting —You can make a PHP script to run without
any server or browser. You only need the PHP parser to use it this
way. These scripts can also be used for simple text processing
tasks similar to PERL
Writing client-side GUI applications —PHP is probably not the very
best language to write windowing applications, but PHP-GTK
(PHP Graphics Tool Kit) can be used to write such programs.
Not dealt with in this course.

Creating, Writing and Executing PHP
• PHP files are simply text files — use any text editor, integrate
with HTML
• File has extension .php
• Store file the same directory as HTML pages (not cgi-bin)

• Link from web pages via standard URL

  • you can use notepad with a file extension .php
  • Install xammp software in system
  • And start the apache server to start programming
  • All the Programming files are saved in Htdocs folder
Including PHP in a Web Page



There are 4 ways of including PHP in a web page
1. <?php echo("Hello world"); ?>
2. <script language = "php">
echo("Hello world");
</script>
3. <? echo("Hello world"); ?>
4. <% echo("Hello world"); %>
You can also use print instead of echo
• Method (1) is clear and unambiguous— My preferred method
• Method (2) is useful in environments supporting mixed scripting
languages in the same HTML file (most do not)
• Methods (3) and (4) depend on the server configuration

Please VISIT This Page For Next Tutorial 

No comments:

Post a Comment