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
Kamar Blbel
 
PDF
Redirect subdomain to webmail
Kaviyarasu Pugaz
 
PPTX
2 Installation of Drupal
Wingston
 
PPTX
3 Configuring Drupal
Wingston
 
PPTX
8 Web Practices for Drupal
Wingston
 
PPTX
WordPress and MAMP
Jim Raffel
 
PPTX
How to install word press on local server
Himanshi Garg
 
PDF
AMP for JavaScripters
Felix Arntz
 
php lesson 1
Kamar Blbel
 
Redirect subdomain to webmail
Kaviyarasu Pugaz
 
2 Installation of Drupal
Wingston
 
3 Configuring Drupal
Wingston
 
8 Web Practices for Drupal
Wingston
 
WordPress and MAMP
Jim Raffel
 
How to install word press on local server
Himanshi Garg
 
AMP for JavaScripters
Felix Arntz
 

What's hot (20)

DOCX
Installing symfony within netbeans and WAMP
Riyad Bin Zaman
 
PDF
How to Install Magento on WAMP Server
APPSeCONNECT
 
PPTX
What To Learn First in PHP
Tessa Mero
 
PPT
Word press & dreamweaver
kmawk
 
PPT
Installation of Drupal on Windows XP with XAMPP
Rupesh Kumar
 
PDF
Master WooCommerce Troubleshooting
Rodolfo Melogli
 
DOCX
Joomla Installation
Ambati Sreedhar
 
PPTX
WooCommerce: How to Customize WordPress via PHP Snippets
Rodolfo Melogli
 
PPTX
WordPress: a stepping stone to Web Development
remixwolf
 
PPT
WordPress Biratnagar Meetup #1Wordpress Installation : By Sajjal Neupane
Pankaj Subedi
 
PPTX
How to Install and Configure Drupal CMS
darandon
 
PPTX
How to Install and Configure Drupal CMS
ffats1
 
PDF
Save Time By Manging WordPress from the Command Line
Shawn Hooper
 
TXT
Read me st
aditya prananda
 
PDF
How to Install WordPress 2014 in cPanel
Kim Muellner
 
PDF
FROM LOCAL TO LIVE: EXPORTING WORDPRESS FROM MAMP
Parsons
 
PPTX
Web application using JSP
Kaml Sah
 
PDF
Word pressinstallation
Kichiemon Adachi
 
PPTX
Expose web service
Son Nguyen
 
PDF
WordPress Q&A
WP Australia
 
Installing symfony within netbeans and WAMP
Riyad Bin Zaman
 
How to Install Magento on WAMP Server
APPSeCONNECT
 
What To Learn First in PHP
Tessa Mero
 
Word press & dreamweaver
kmawk
 
Installation of Drupal on Windows XP with XAMPP
Rupesh Kumar
 
Master WooCommerce Troubleshooting
Rodolfo Melogli
 
Joomla Installation
Ambati Sreedhar
 
WooCommerce: How to Customize WordPress via PHP Snippets
Rodolfo Melogli
 
WordPress: a stepping stone to Web Development
remixwolf
 
WordPress Biratnagar Meetup #1Wordpress Installation : By Sajjal Neupane
Pankaj Subedi
 
How to Install and Configure Drupal CMS
darandon
 
How to Install and Configure Drupal CMS
ffats1
 
Save Time By Manging WordPress from the Command Line
Shawn Hooper
 
Read me st
aditya prananda
 
How to Install WordPress 2014 in cPanel
Kim Muellner
 
FROM LOCAL TO LIVE: EXPORTING WORDPRESS FROM MAMP
Parsons
 
Web application using JSP
Kaml Sah
 
Word pressinstallation
Kichiemon Adachi
 
Expose web service
Son Nguyen
 
WordPress Q&A
WP Australia
 
Ad

Viewers also liked (17)

PDF
basic concept of php(Gunikhan sonowal)
Guni Sonow
 
PPTX
Dreamweaver cs6 multiple browsers and devices training demo
yunjuli
 
PDF
Basic tutorial dreamweaver_cs5
seanoiii
 
PPTX
Dreamweaver
Jacqueline Wanner
 
DOC
Modul pengenalan dreamweaver
RomaAngga
 
DOCX
modul pemrograman web dengan dreamweaver, sql & php
Ismi Islamia
 
PPT
Tutorial 08 - Creating Effective Web Pages
dpd
 
PDF
Designing Responsively with Dreamweaver
jameswillweb
 
PPTX
How to Use Dreamweaver cs6
Salman Memon
 
PDF
Dreamweaver cs6 step by step
zoran Jelinek
 
DOCX
PHP HTML CSS Notes
Tushar Rajput
 
PPT
Tutorial 8 - Creating Effective Web Pages
dpd
 
PDF
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dee Sadler
 
PDF
Web app development_cookies_sessions_14
Hassen Poreya
 
PDF
Tutorial PHP and Dreamweaver CS3
Halizah Ahmad
 
PPTX
Basic of PHP
Nisa Soomro
 
PPTX
Php Tutorial
pratik tambekar
 
basic concept of php(Gunikhan sonowal)
Guni Sonow
 
Dreamweaver cs6 multiple browsers and devices training demo
yunjuli
 
Basic tutorial dreamweaver_cs5
seanoiii
 
Dreamweaver
Jacqueline Wanner
 
Modul pengenalan dreamweaver
RomaAngga
 
modul pemrograman web dengan dreamweaver, sql & php
Ismi Islamia
 
Tutorial 08 - Creating Effective Web Pages
dpd
 
Designing Responsively with Dreamweaver
jameswillweb
 
How to Use Dreamweaver cs6
Salman Memon
 
Dreamweaver cs6 step by step
zoran Jelinek
 
PHP HTML CSS Notes
Tushar Rajput
 
Tutorial 8 - Creating Effective Web Pages
dpd
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dee Sadler
 
Web app development_cookies_sessions_14
Hassen Poreya
 
Tutorial PHP and Dreamweaver CS3
Halizah Ahmad
 
Basic of PHP
Nisa Soomro
 
Php Tutorial
pratik tambekar
 
Ad

Similar to php tutorial - By Bally Chohan (20)

PPT
Beginners PHP Tutorial
alexjones89
 
DOC
Php tutorial
S Bharadwaj
 
DOCX
PHP Lesson
Rithirun Meas
 
PPT
Mantis Installation for Windows Box
guest34a3a419
 
PPT
Mantis Installation for Windows Box
Jayanta Dash
 
PPTX
Upstate CSCI 450 PHP
DanWooster1
 
PDF
UNIT4.pdf php basic programming for begginers
AAFREEN SHAIKH
 
DOC
Article 01 What Is Php
drperl
 
PDF
Php tizag tutorial
jaggu536
 
PDF
php_tizag_tutorial
tutorialsruby
 
PDF
php_tizag_tutorial
tutorialsruby
 
PDF
PHP learning
Self-Employed
 
PDF
Php tizag tutorial
Pradeep Kumar
 
PDF
Php tizag tutorial
PrinceGuru MS
 
PDF
Installation instruction of Testlink
usha kannappan
 
PPTX
Theming Wordpress for Your Showcases
Jun Hu
 
PDF
Wamp & LAMP - Installation and Configuration
Chetan Soni
 
KEY
Introduction to php
jgarifuna
 
PDF
Visual guide15
tungvt0303
 
PDF
Selenium Ide Tutorial
metapix
 
Beginners PHP Tutorial
alexjones89
 
Php tutorial
S Bharadwaj
 
PHP Lesson
Rithirun Meas
 
Mantis Installation for Windows Box
guest34a3a419
 
Mantis Installation for Windows Box
Jayanta Dash
 
Upstate CSCI 450 PHP
DanWooster1
 
UNIT4.pdf php basic programming for begginers
AAFREEN SHAIKH
 
Article 01 What Is Php
drperl
 
Php tizag tutorial
jaggu536
 
php_tizag_tutorial
tutorialsruby
 
php_tizag_tutorial
tutorialsruby
 
PHP learning
Self-Employed
 
Php tizag tutorial
Pradeep Kumar
 
Php tizag tutorial
PrinceGuru MS
 
Installation instruction of Testlink
usha kannappan
 
Theming Wordpress for Your Showcases
Jun Hu
 
Wamp & LAMP - Installation and Configuration
Chetan Soni
 
Introduction to php
jgarifuna
 
Visual guide15
tungvt0303
 
Selenium Ide Tutorial
metapix
 

More from ballychohanuk (6)

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

Recently uploaded (20)

PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
PDF
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
PPTX
Congenital Hypothyroidism pptx
AneetaSharma15
 
PPTX
How to Manage Global Discount in Odoo 18 POS
Celine George
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PDF
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTX
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
PDF
Landforms and landscapes data surprise preview
jpinnuck
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
5.EXPLORING-FORCES-Detailed-Notes.pdf/8TH CLASS SCIENCE CURIOSITY
Sandeep Swamy
 
Congenital Hypothyroidism pptx
AneetaSharma15
 
How to Manage Global Discount in Odoo 18 POS
Celine George
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
Landforms and landscapes data surprise preview
jpinnuck
 

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