- Impact
- 18
Hello... here is the beginer's tutorial to starting php:
Ok, here is your first script - The, infamous, astounding, excellent Hello World application:
Take a look at that code. Now you need the <?php & ?> tags. They tell your server (as it is a server-side program, which means that the server processes it before sending the output to the users browser) that the page you are trying to access has php that needs to be compiled.
Chances are that you will need to save your script as a php file. Save it as something memorable, so that you can view it first (ie: hello.php). If you are using notepad to write this then you should insert the name (in the save box) with double quotes round it: "hello.php". This will save it as a php file.
Run the program now. The browser should show "Hello, World" in the top left hand corner.
The "echo" command just prints a string of text to the browser. So thats why you see "Hello, World" from "echo "Hello, World";".
Well done, that is your first php script! Hope this helps anyone who wants to start PHP!
Websites to visit: www.webmonkey.com, www.php.net
Ok, here is your first script - The, infamous, astounding, excellent Hello World application:
PHP:
<?php
echo "Hello, World";
?>
Take a look at that code. Now you need the <?php & ?> tags. They tell your server (as it is a server-side program, which means that the server processes it before sending the output to the users browser) that the page you are trying to access has php that needs to be compiled.
Chances are that you will need to save your script as a php file. Save it as something memorable, so that you can view it first (ie: hello.php). If you are using notepad to write this then you should insert the name (in the save box) with double quotes round it: "hello.php". This will save it as a php file.
Run the program now. The browser should show "Hello, World" in the top left hand corner.
The "echo" command just prints a string of text to the browser. So thats why you see "Hello, World" from "echo "Hello, World";".
Well done, that is your first php script! Hope this helps anyone who wants to start PHP!
Websites to visit: www.webmonkey.com, www.php.net