SlideShare a Scribd company logo
A beginners tutorial
in PHP
By Bally Chohan
Step 1:
 To use PHP you’ll need a server to work
on and test your page…
 You may already have web space with
PHP installed to work on,
 Or you may already have a server
installed on your system,
 If not you’ll need to install one yourself….
- Bally Chohan
Installing a server:
 An easy way to aquire an Apache server,
along with PHP and MySQL built in (you’ll
need these when using PHP), is using
 WAMP (Windows) or,
 MAMP (Mac) (http://www.mamp.info)
 LAMP (Linux)
You can download WAMP at
http://www.wampserver.com/en/
- Bally Chohan
Step 2:
 Once you have followed the online instructions
for installing and configuring WAMP, you need to
check it works!
 Open notepad (php can be added straight into
your html) and type:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
- Bally Chohan
Testing:
 Save this as ‘hello.php’ in your ‘www’ folder
located within your WAMP folder.
 This can be done by selecting ‘all files’ when
saving rather than the default ‘.txt’
 (Note: you can also just type this script straight
into a new document in Dreamweaver if
preferred)
 Now preview by opening your browser and
entering http://localhost/hello.php
 Your page should look like this…
- Bally Chohan
- Bally Chohan
Step 3: Variables
 Variables will allow a value to be changed
throughout your page without having to go
through and find it every time you need it
changed.
 A variable can be defined by using ‘$’ at the
beginning of your variable name. e.g.
$variable = ‘value’
 A variable must start with a letter or underscore
and can only contain letters, numbers or
underscores, and must not use spaces
- Bally Chohan
Variables: a simple example
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
$weather="sunny";
echo 'Hello World it’s ';
echo $weather;
?>
</body>
</html>
Note: every line of PHP must end in ‘ ; ’ - Bally Chohan
The result should look like this:
Now to experiment!
 For more information on PHP and the next
steps in learning syntax why not try:
 http://www.w3schools.com/PHP/php_string.asp
 http://www.developphp.com/
- Bally Chohan
Thank You .......
-Bally Chohan

More Related Content

PPT
php lesson 1
PDF
Redirect subdomain to webmail
PPTX
2 Installation of Drupal
PPTX
3 Configuring Drupal
PPTX
8 Web Practices for Drupal
PPTX
WordPress and MAMP
PPTX
How to install word press on local server
PDF
AMP for JavaScripters
php lesson 1
Redirect subdomain to webmail
2 Installation of Drupal
3 Configuring Drupal
8 Web Practices for Drupal
WordPress and MAMP
How to install word press on local server
AMP for JavaScripters

What's hot (20)

DOCX
Installing symfony within netbeans and WAMP
PDF
How to Install Magento on WAMP Server
PPTX
What To Learn First in PHP
PPT
Word press & dreamweaver
PPT
Installation of Drupal on Windows XP with XAMPP
PDF
Master WooCommerce Troubleshooting
DOCX
Joomla Installation
PPTX
WooCommerce: How to Customize WordPress via PHP Snippets
PPTX
WordPress: a stepping stone to Web Development
PPT
WordPress Biratnagar Meetup #1Wordpress Installation : By Sajjal Neupane
PPTX
How to Install and Configure Drupal CMS
PPTX
How to Install and Configure Drupal CMS
PDF
Save Time By Manging WordPress from the Command Line
TXT
Read me st
PDF
How to Install WordPress 2014 in cPanel
PDF
FROM LOCAL TO LIVE: EXPORTING WORDPRESS FROM MAMP
PPTX
Web application using JSP
PDF
Word pressinstallation
PPTX
Expose web service
PDF
WordPress Q&A
Installing symfony within netbeans and WAMP
How to Install Magento on WAMP Server
What To Learn First in PHP
Word press & dreamweaver
Installation of Drupal on Windows XP with XAMPP
Master WooCommerce Troubleshooting
Joomla Installation
WooCommerce: How to Customize WordPress via PHP Snippets
WordPress: a stepping stone to Web Development
WordPress Biratnagar Meetup #1Wordpress Installation : By Sajjal Neupane
How to Install and Configure Drupal CMS
How to Install and Configure Drupal CMS
Save Time By Manging WordPress from the Command Line
Read me st
How to Install WordPress 2014 in cPanel
FROM LOCAL TO LIVE: EXPORTING WORDPRESS FROM MAMP
Web application using JSP
Word pressinstallation
Expose web service
WordPress Q&A
Ad

Viewers also liked (17)

PDF
basic concept of php(Gunikhan sonowal)
PPTX
Dreamweaver cs6 multiple browsers and devices training demo
PDF
Basic tutorial dreamweaver_cs5
PPTX
Dreamweaver
DOC
Modul pengenalan dreamweaver
DOCX
modul pemrograman web dengan dreamweaver, sql & php
PPT
Tutorial 08 - Creating Effective Web Pages
 
PDF
Designing Responsively with Dreamweaver
PPTX
How to Use Dreamweaver cs6
PDF
Dreamweaver cs6 step by step
DOCX
PHP HTML CSS Notes
PPT
Tutorial 8 - Creating Effective Web Pages
 
PDF
Dreamweaver CS6, jQuery, PhoneGap, mobile design
PDF
Web app development_cookies_sessions_14
PDF
Tutorial PHP and Dreamweaver CS3
PPTX
Basic of PHP
PPTX
Php Tutorial
basic concept of php(Gunikhan sonowal)
Dreamweaver cs6 multiple browsers and devices training demo
Basic tutorial dreamweaver_cs5
Dreamweaver
Modul pengenalan dreamweaver
modul pemrograman web dengan dreamweaver, sql & php
Tutorial 08 - Creating Effective Web Pages
 
Designing Responsively with Dreamweaver
How to Use Dreamweaver cs6
Dreamweaver cs6 step by step
PHP HTML CSS Notes
Tutorial 8 - Creating Effective Web Pages
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Web app development_cookies_sessions_14
Tutorial PHP and Dreamweaver CS3
Basic of PHP
Php Tutorial
Ad

Similar to php tutorial - By Bally Chohan (20)

PPT
Beginners PHP Tutorial
DOC
Php tutorial
DOCX
PHP Lesson
PPT
Mantis Installation for Windows Box
PPT
Mantis Installation for Windows Box
PPTX
Upstate CSCI 450 PHP
PDF
UNIT4.pdf php basic programming for begginers
DOC
Article 01 What Is Php
PDF
Php tizag tutorial
PDF
Php tizag tutorial
PDF
php_tizag_tutorial
PDF
php_tizag_tutorial
PDF
PHP learning
PDF
Php tizag tutorial
PDF
Installation instruction of Testlink
PPTX
Theming Wordpress for Your Showcases
PDF
Wamp & LAMP - Installation and Configuration
KEY
Introduction to php
PDF
Visual guide15
PDF
Selenium Ide Tutorial
Beginners PHP Tutorial
Php tutorial
PHP Lesson
Mantis Installation for Windows Box
Mantis Installation for Windows Box
Upstate CSCI 450 PHP
UNIT4.pdf php basic programming for begginers
Article 01 What Is Php
Php tizag tutorial
Php tizag tutorial
php_tizag_tutorial
php_tizag_tutorial
PHP learning
Php tizag tutorial
Installation instruction of Testlink
Theming Wordpress for Your Showcases
Wamp & LAMP - Installation and Configuration
Introduction to php
Visual guide15
Selenium Ide Tutorial

More from ballychohanuk (6)

PPTX
Bally chohan yoga | Best Yoga Classes in UK
PPTX
Bally Chohan Job Portal UK
PPTX
Ballychohan yoga 1
PPTX
Wordpress tutorial- By Bally Chohan
PPTX
jQuery Tutorial - By Bally Chohan
PPTX
Html 5 tutorial - By Bally Chohan
Bally chohan yoga | Best Yoga Classes in UK
Bally Chohan Job Portal UK
Ballychohan yoga 1
Wordpress tutorial- By Bally Chohan
jQuery Tutorial - By Bally Chohan
Html 5 tutorial - By Bally Chohan

Recently uploaded (20)

PPTX
master seminar digital applications in india
PPTX
Cell Structure & Organelles in detailed.
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Insiders guide to clinical Medicine.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Business Ethics Teaching Materials for college
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Classroom Observation Tools for Teachers
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
O7-L3 Supply Chain Operations - ICLT Program
master seminar digital applications in india
Cell Structure & Organelles in detailed.
Anesthesia in Laparoscopic Surgery in India
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
O5-L3 Freight Transport Ops (International) V1.pdf
Microbial diseases, their pathogenesis and prophylaxis
Renaissance Architecture: A Journey from Faith to Humanism
Insiders guide to clinical Medicine.pdf
Basic Mud Logging Guide for educational purpose
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Business Ethics Teaching Materials for college
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
VCE English Exam - Section C Student Revision Booklet
PPH.pptx obstetrics and gynecology in nursing
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Classroom Observation Tools for Teachers
Microbial disease of the cardiovascular and lymphatic systems
Pharmacology of Heart Failure /Pharmacotherapy of CHF
O7-L3 Supply Chain Operations - ICLT Program

php tutorial - By Bally Chohan

  • 1. A beginners tutorial in PHP By Bally Chohan
  • 2. Step 1:  To use PHP you’ll need a server to work on and test your page…  You may already have web space with PHP installed to work on,  Or you may already have a server installed on your system,  If not you’ll need to install one yourself…. - Bally Chohan
  • 3. Installing a server:  An easy way to aquire an Apache server, along with PHP and MySQL built in (you’ll need these when using PHP), is using  WAMP (Windows) or,  MAMP (Mac) (http://www.mamp.info)  LAMP (Linux) You can download WAMP at http://www.wampserver.com/en/ - Bally Chohan
  • 4. Step 2:  Once you have followed the online instructions for installing and configuring WAMP, you need to check it works!  Open notepad (php can be added straight into your html) and type: <html> <head> <title>PHP Test</title> </head> <body> <?php echo '<p>Hello World</p>'; ?> </body> </html> - Bally Chohan
  • 5. Testing:  Save this as ‘hello.php’ in your ‘www’ folder located within your WAMP folder.  This can be done by selecting ‘all files’ when saving rather than the default ‘.txt’  (Note: you can also just type this script straight into a new document in Dreamweaver if preferred)  Now preview by opening your browser and entering http://localhost/hello.php  Your page should look like this… - Bally Chohan
  • 7. Step 3: Variables  Variables will allow a value to be changed throughout your page without having to go through and find it every time you need it changed.  A variable can be defined by using ‘$’ at the beginning of your variable name. e.g. $variable = ‘value’  A variable must start with a letter or underscore and can only contain letters, numbers or underscores, and must not use spaces - Bally Chohan
  • 8. Variables: a simple example <html> <head> <title>PHP Test</title> </head> <body> <?php $weather="sunny"; echo 'Hello World it’s '; echo $weather; ?> </body> </html> Note: every line of PHP must end in ‘ ; ’ - Bally Chohan
  • 9. The result should look like this:
  • 10. Now to experiment!  For more information on PHP and the next steps in learning syntax why not try:  http://www.w3schools.com/PHP/php_string.asp  http://www.developphp.com/ - Bally Chohan