LET'S LEARN PHP STEP BY STEP
Posted: Wed Oct 27, 2010 11:56 am
Hi mates,
I'll try to start a simple tutorial for biginners to know about the environment of PHP
first of all :
PHP is a powerfull script especially when it's used with MYSQL to build dynamic websites .
the first thing we should know about PHP is
it has start and end it always starts with <?php or you can type it as <? but it's better to start with <?php and then you use <? in the script.
the the satart is <?php
and to end it we use ?>
today we are in the first tutorial session
we wil creat a simple TIP of A DAY site and from this we will learn many things about HTML and CSS
START
REquirmnets for PHP to work:
you can try it locally by using a virtual server like WAMP if you are using windows and there is another one for MAC it's called MAMP
I'm expecting that you have a WAMP server appache running on your computer . IF you don't have it you can download it from
http://www.wampserver.com/en/
for Mac users they can download it from http://www.mamp.info/en/index.html
after installing WAMP or MAMP go to your explorer or Firfox and type http://localhost on your address
then you will see the appache server.
for the first before making the TIP of the day site are going to open our notepad of the window and type
<?php
phpinfo();
?>
that 's all then save the file as test.php ( but here be carefull . when saving use save as
choose all files from save as type then type test.php then save . if you save it without this way your file will be test.txt.php and you will not get anything.
if you did that step and see a very long page with many information about php . YOU ARE LUCKY
START WITH TIP OF THE DAY
open your notepad then
copy and paste this script
after paste inh the script save it as tipsoftheday.php(remeber what we said before)
now go to your C: hardisk doubleclick on it you will find a directory called WAMP open it and you will find another directory inside called www (here we will put all our files and folders)
open WWW then paste your file there.
after pasting your file go to IE or firefox and type http://localhost/tipoftheday.php and you'll find your site ( explore it and wait for the next session)
Thanks for reading and sorry for my language i'm not native English
I'll try to start a simple tutorial for biginners to know about the environment of PHP
first of all :
PHP is a powerfull script especially when it's used with MYSQL to build dynamic websites .
the first thing we should know about PHP is
it has start and end it always starts with <?php or you can type it as <? but it's better to start with <?php and then you use <? in the script.
the the satart is <?php
and to end it we use ?>
today we are in the first tutorial session
we wil creat a simple TIP of A DAY site and from this we will learn many things about HTML and CSS
START
REquirmnets for PHP to work:
you can try it locally by using a virtual server like WAMP if you are using windows and there is another one for MAC it's called MAMP
I'm expecting that you have a WAMP server appache running on your computer . IF you don't have it you can download it from
http://www.wampserver.com/en/
for Mac users they can download it from http://www.mamp.info/en/index.html
after installing WAMP or MAMP go to your explorer or Firfox and type http://localhost on your address
then you will see the appache server.
for the first before making the TIP of the day site are going to open our notepad of the window and type
<?php
phpinfo();
?>
that 's all then save the file as test.php ( but here be carefull . when saving use save as
choose all files from save as type then type test.php then save . if you save it without this way your file will be test.txt.php and you will not get anything.
if you did that step and see a very long page with many information about php . YOU ARE LUCKY
START WITH TIP OF THE DAY
open your notepad then
copy and paste this script
Code: Select all
<html>
<head>
<title>Tip of the day</title>
</head>
<body>
<center>
<h1>Tip of the day</h1>
<div style = “border-color:green; border-style:groove; border-width:2px”>
<?
readfile("tips.txt");
?>
</div>
</center>
</body>
</html>
after paste inh the script save it as tipsoftheday.php(remeber what we said before)
now go to your C: hardisk doubleclick on it you will find a directory called WAMP open it and you will find another directory inside called www (here we will put all our files and folders)
open WWW then paste your file there.
after pasting your file go to IE or firefox and type http://localhost/tipoftheday.php and you'll find your site ( explore it and wait for the next session)
Thanks for reading and sorry for my language i'm not native English