Upload
jatin-batra
View
43
Download
1
Embed Size (px)
Citation preview
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
What is PHPAdvantages of Using PHP to enhance Web Pages:
Easy to use
Open source
Multiple platform
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
How PHP Pages are Accessed & Interpreted
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
Getting Started with PHPTo develop and publish PHP script all you need is :
A web server with PHP built into it
A client machine with a basic text editor and internet connection
FTP or Telnet software
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
Exploring the basic PHP development process
The basic step you can use to develop and publish PHP pages are:
Create a PHP script file and save to a local disk
Use FTP to copy the file to the server
Access your file using a server
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
Creating a PHP Script File & Saving it to a local disk
You can use a number of different editors to create your PHP script files.
The PHP script with a <?php tag
and ends with?>
Between these tags is a single
PHP print statement.
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
Alternative PHP Delimiters You can alternatively start your PHP script with the <script> tag as follows:
-- <script language=“PHP”>
print ( “A simple initial script”);
</script>
If have short_open_tag enabled in its configuration file, you can use<?and ?>
If asp_tags is enabled in the PHP configuration file, you can use < % and % > as
delimiters.
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
Copying Files to a web Server with FTP
Connect to the internet and start
FTP
Connect to your Web server with
FTP
Copy files to the web server
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
Accessing your File Using a Browser
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
Proper Syntax If you have a syntax error than you have written one or more PHP
statements that are grammatically incorrect in the PHP language
The print statement syntax:
Print ( “your message to print” ) ;
Enclose message in quotation marks
Parenthesis are optional
End in a semi-colon
Message to output
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
If use Improper syntax
1. <?php
2. Print (“A simple initial script);
3. ?>
Suppose you use the wrong syntax
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
If use Improper syntax
1. Be careful to use quotation marks, parentheses, and brackets in
pairs.
2. Most PHP commands end with a semicolon (;)
3. Be careful of case
4. PHP ignores blank spaces
Some PHP syntax Issues:
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]
ADDRESS: SCO -15, Dayal Bagh, Near Hanuman Mandir Ambala Cantt-133001 HaryanaPh. No.: 9729666670, 8222066670 &0171-4000670Email ID: [email protected]: www.batracomputercentre.com
BATRA COMPUTER CENTRE
Website: www.batracomputercentre.com Ph.no.: 8222066670, 4000670
Email: [email protected]