Date post: | 29-May-2015 |
Category: |
Documents |
Upload: | elisesumanga |
View: | 475 times |
Download: | 2 times |
inA tutorial made by:Elise Margaret R.
Sumanga
PHP is a widely used
language which stands for
PHP: Hypertext Preprocessor
PHP files can contain text,
HTML, JavaScript code, and PHP
code.
To test PHP files, make sure you’ve installed..
.
XAMPP interprets scripts written in PHP.
XAMPP is an integrated
server package of:
•Apache•mySQL
•PHP• Perl
To test if XAMPP is properly running...
Locate“c:\xampp”folder
Open the xampp_star
t applicatio
n
All PHP files should be saved in the htdocs folder
“c:\xampp\htdocs”
Let’s start this tutorial by opening the text editor that
you’ll fall in with!
I am using Sublime Text 2 and this is what it looks like :D
PHP scripts can be placed
anywhere in the
document.BASIC PHP SYNTAX
It starts with <?php and ends
with ?>
BASIC PHP SYNTAX
To output strings in the browser,
we can use PHP’s echo or print
All PHP files should have .php as its default
file extension.
Let’s save our work and name
it..
Helloworld.php
Again, all PHP files should be saved in the htdocs folder“c:\xampp\htdocs”
After saving, you’ll notice that the color of the code changes
There you have it. Now, it’s time to test the code.
http://localhost/[nameofyourfile.php]
Open your
browser and
type:
So in our case:http://localhost/helloworld.php