This is the first part of the php script language tutorial.
Basic: you need a webserver that support php and mysql
They are many free hosting providers but for experimenting i suggest that you install on your computer wamp.
When you install wamp or create an account with a free hosting provider
open a new document in the www directory in c:\wamp and name it index.php
paste the code below
ok what the above code does?
<html> are html tags
between <?php ?> are php script tags
echo "Prints something to the screen";
it can be done like this echo "hello";
or echo "hi
this is a test message";
Ok how we insert comments ?
comments are inserted like this
Remember the code must be surrounded by <?php ?>
or it will be showed to the users browsers
This is the fist tutorial and is very simple.
Basic: you need a webserver that support php and mysql
They are many free hosting providers but for experimenting i suggest that you install on your computer wamp.
When you install wamp or create an account with a free hosting provider
open a new document in the www directory in c:\wamp and name it index.php
paste the code below
<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>
ok what the above code does?
<html> are html tags
between <?php ?> are php script tags
echo "Prints something to the screen";
it can be done like this echo "hello";
or echo "hi
this is a test message";
Ok how we insert comments ?
comments are inserted like this
//single line comment
/*
This is a
multi line code
*/
Remember the code must be surrounded by <?php ?>
or it will be showed to the users browsers
This is the fist tutorial and is very simple.
No comments:
Post a Comment