php tutorial - By Bally Chohan - PowerPoint PPT Presentation

About This Presentation
Title:

php tutorial - By Bally Chohan

Description:

this php tutorial is presented by Bally Chohan for php beginners in website designing. – PowerPoint PPT presentation

Number of Views:902

less

Transcript and Presenter's Notes

Title: php tutorial - By Bally Chohan


1
A beginners tutorial in PHPBy Bally Chohan
2
Step 1
  • To use PHP youll 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 youll 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 (youll 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
  • lthtmlgt
  • ltheadgt
  • lttitlegtPHP Testlt/titlegt
  • lt/headgt
  • ltbodygt
  • lt?php echo 'ltpgtHello Worldlt/pgt' ?gt
  • lt/bodygt
  • lt/htmlgt

- 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
6
- 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
  • lthtmlgt
  • ltheadgt
  • lttitlegtPHP Testlt/titlegt
  • lt/headgt
  • ltbodygt
  • lt?php
  • weather"sunny"
  • echo 'Hello World its '
  • echo weather
  • ?gt
  • lt/bodygt
  • lt/htmlgt
  • 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
11
Thank You .......-Bally Chohan
Write a Comment
User Comments (0)
About PowerShow.com