Вы находитесь на странице: 1из 17

Yellow

BELT
OnlyKiosk Coding

Get Tools Ready

OnlyKiosk Coding

Create PHP files:


Notepad++ is a code editor.
Its reliable, light and fast.
Its free and open-source.
Ps: there are many other editors and you can use anyone you like

OnlyKiosk Coding

How to

install and use Notepad++

http://notepad-plus-plus.org/

OnlyKiosk Coding

How to install and

use Notepad++

1.Open Notepad++
2.Set language to PHP
3.Write your code
4.Click save button
5.Name your file and save it
Question: where do you think the PHP file should be saved?

OnlyKiosk Coding

Process PHP files:


WampServer is a Windows web development
environment.
It allows you to create web applications with
Apache2, PHP and a MySQL database.
Alongside, PhpMyAdmin allows you to manage easily
your database
Ps: dont worry about MySQL database, well get to it later

OnlyKiosk Coding

How to

install and use WAMP

http://www.wampserver.com/en/

OnlyKiosk Coding

How to install and

use WAMP

1.Click WAMP icon;


2.Wait for the icon to change color:
Red=> Orange=> Green
3. Green means you are ready to go.

OnlyKiosk Coding

Test PHP files:


How to test PHP files?

http://Localhost/the_name_of_your_PHP_file.php

OnlyKiosk Coding

Review & Practice:


1. Switch on Notepad++ and WAMP and wait till the WAMP icon turns
green;
2. Copy the following codes and paste them to Notepad++;
<?php
echo "this is my first PHP file";
?>
ps: just copy and paste these codes, we will get to them later

3. Click the save button and name the file:


yellow_belt_my_first_php_file.php;
4. Save the file to the desktop;
5. Open your browser and type in:
localhost/yellow_belt_my_first_php_file.php;

OnlyKiosk Coding

Review & Practice:


<?php
echo "this is my first PHP file";
?>
ps: just copy and paste these codes, we will get to them later

if everything is fine, you should see


this is my first PHP file
on your browser

OnlyKiosk Coding

404 means file cannot be found.


URL: Uniform Resource Locator
the address and postal code of a computer file
OnlyKiosk Coding

the PHP file is stored in the wrong place

OnlyKiosk Coding

We definitely got the file name correct, so which


part went wrong?

As a programmer, its very important that you are


able to figure things out by yourself. Should you
encounter something you dont know how to deal
with, ask the internet.

By the way, do you still remember the question


we left unanswered where should we save our
PHP file?

WWW folder under the wamp program


OnlyKiosk Coding

Now you can see, you should put your


PHP file in the WWW folder.
Localhost/ + PHP file name + .php

OnlyKiosk Coding

But what if I want to put the file in a file folder inside the
WWW folder, like:
www/ yellow_belt / yb_first_php_file.php
Thats easy, just do this:
Localhost/ + folder_name/ + PHP file name.php

URL:uniformresourcelocator
OnlyKiosk Coding

Summary:

Know how to install and use Notepad++;


Know how to install and use WAMP;
Know how to create and name a PHP file;
Know where to save your PHP file;
Know how to test your PHP file on a browser;

Next:

OnlyKiosk Coding

Вам также может понравиться