- -
-- | - | |
- |
- - Php Tutorial/ Action |
- |
- | - | |
- | - | |
- | - | |
- | - | - - - - - -|
- | - | |
- | - | |
- | - | |
- |
-
-
-
-
-
-
-
As in all good tutorials, we start with the (in)famous HelloWorld example. Here's the code: -
-
-
-
You should save this piece of code in a file with the extension
It should contain a line that looks like this: AddType application/x-httpd-php .php-
Anyway --- this line informs Apache that files ending with
Back to the example, which is somewhat silly. But it can be used to teach you a few things anyway. -
Most of the code is just plain HTML. Only the part between
Between the two tags there is a comment and one statement,
As you can see, there's no trace of the PHP-code left in the final output. In the following code-snippets I won't include all the HTML code, but remember that you'll have to use HTML if you want your PHP scripts to work on the net. You'll also have to include the right HTML codes in the strings you output from PHP, if you're outputting more than just very simple strings. -
You should think of a PHP-script as a normal web page written in HTML, since most of the page is still just plain-old HTML. But between the start- and end-tags (
|
- |
- | - | |
- | - | |
- | - | |
- | - | -|
- | - |