SlideShare a Scribd company logo
A beginners tutorial in PHP
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….
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/
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>
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…
 
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
Variables: a simple example <html> <head> <title>PHP Test</title> </head> <body> <?php  $weather=&quot;sunny&quot;; echo 'Hello World it’s ';  echo $weather; ?>   </body> </html> Note: every line of PHP must end in ‘  ; ’
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.webmonkey.com/tutorial/PHP_Tutorial_for_Beginners#Basic_Syntax http://www.developphp.com/
The End.

More Related Content

PPTX
Complete Lecture on Css presentation
PPT
JavaScript & Dom Manipulation
PPTX
An Overview of HTML, CSS & Java Script
PPT
Php Presentation
PPT
Php with MYSQL Database
PPT
JavaScript Tutorial
PDF
Introduction to php
PPSX
Javascript variables and datatypes
Complete Lecture on Css presentation
JavaScript & Dom Manipulation
An Overview of HTML, CSS & Java Script
Php Presentation
Php with MYSQL Database
JavaScript Tutorial
Introduction to php
Javascript variables and datatypes

What's hot (20)

PPT
PHP complete reference with database concepts for beginners
PPT
PDF
jQuery for beginners
PPT
Introduction to JavaScript (1).ppt
PPTX
Introduction to php
PDF
Php Tutorials for Beginners
PPTX
css.ppt
PDF
Html for beginners
PPT
cascading style sheet ppt
PDF
Javascript basics
PPT
Php Ppt
PPSX
Php and MySQL
PDF
JavaScript - Chapter 12 - Document Object Model
PPTX
Php.ppt
PPTX
Java script
PPT
PPTX
HTML Fundamentals
PHP complete reference with database concepts for beginners
jQuery for beginners
Introduction to JavaScript (1).ppt
Introduction to php
Php Tutorials for Beginners
css.ppt
Html for beginners
cascading style sheet ppt
Javascript basics
Php Ppt
Php and MySQL
JavaScript - Chapter 12 - Document Object Model
Php.ppt
Java script
HTML Fundamentals
Ad

Similar to Beginners PHP Tutorial (20)

PPTX
php tutorial - By Bally Chohan
DOC
Php tutorial
DOCX
PHP Lesson
DOC
Article 01 What Is Php
PPT
Web development
PPTX
php basics
PPT
Babitha5.php
PPT
Babitha5.php
PPT
Babitha5.php
PDF
Php tizag tutorial
PDF
php_tizag_tutorial
PDF
php_tizag_tutorial
PDF
PHP learning
PDF
Php tizag tutorial
PDF
Php tizag tutorial
PPT
Introduction To Php For Wit2009
PPTX
Introduction to-php
PPT
Intro to-php-19 jun10
PPT
php tutorial - By Bally Chohan
Php tutorial
PHP Lesson
Article 01 What Is Php
Web development
php basics
Babitha5.php
Babitha5.php
Babitha5.php
Php tizag tutorial
php_tizag_tutorial
php_tizag_tutorial
PHP learning
Php tizag tutorial
Php tizag tutorial
Introduction To Php For Wit2009
Introduction to-php
Intro to-php-19 jun10
Ad

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
KodekX | Application Modernization Development
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
The AUB Centre for AI in Media Proposal.docx
Big Data Technologies - Introduction.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
KodekX | Application Modernization Development
Understanding_Digital_Forensics_Presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx

Beginners PHP Tutorial

  • 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….
  • 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/
  • 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>
  • 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…
  • 6.  
  • 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
  • 8. Variables: a simple example <html> <head> <title>PHP Test</title> </head> <body> <?php $weather=&quot;sunny&quot;; echo 'Hello World it’s '; echo $weather; ?> </body> </html> Note: every line of PHP must end in ‘ ; ’
  • 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.webmonkey.com/tutorial/PHP_Tutorial_for_Beginners#Basic_Syntax http://www.developphp.com/