• Log in or sign up for an account here: https://www.sythe.org/login

PHP - [Tutorial] #1 - The PHP "Hello World" and Echo Function

speedster239

Forum Addict
Joined
Jan 21, 2007
Sythe Gold
0
Messages
313
Location
Arkansas
PHP - [Tutorial] #1 - The PHP "Hello World" and Echo Function
Welcome to Tutorial Number One in the Speedster239 PHP series.

---Learning The PHP Syntax and The Echo Function---

Step 1.) Let's start our script, open up notepad, click save, select all files and save as helloworld.php

To begin EVERY php script place the following line..
Code:
<?
This is the general starting syntax to a php script.

Step 2.) The Echo function is the most basic php function you will learn. It is one of the only functions which allow you to output html onto your page. Today we will be using it to print "Hello World"

Type the following.

Code:
echo "<b>Hello World</b>";

Notice how we ended the statement with a ";" (semicolon). You will do this after every php statement you ever type.IF you do not type this the script will stop executing.

Also, notice how we used some html (<b> </b>) in the parentheses. Echo allows you to use html!

Step 3.) To finish off the script, as always, type the following.

Code:
?>

Step 4.) Upload it to your webserver and run it in your browser. The completed script should appear as follows..

Code:
<?
echo "Hello World!";
?>

I hope this helps!

Speedster239... (more to come)
 
PHP - [Tutorial] #1 - The PHP "Hello World" and Echo Function
pretty good for a start sounds like more tuts comeing?
 
PHP - [Tutorial] #1 - The PHP "Hello World" and Echo Function
Good tutorial...
 
PHP - [Tutorial] #1 - The PHP "Hello World" and Echo Function
if you have a tutorial on setting up a php/mysql/iis7 on windows vista it would be nice. cant figure it out on the life of me and i dont want to use apache. Thanks for the tutorial.
 
Runescape Gamblingrunescape gambling
Back
Top