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

Discussion in 'Web Programming' started by speedster239, Sep 8, 2007.

PHP - [Tutorial] #1 - The PHP "Hello World" and Echo Function
  1. Unread #1 - Sep 8, 2007 at 10:40 PM
  2. speedster239
    Joined:
    Jan 21, 2007
    Posts:
    313
    Referrals:
    0
    Sythe Gold:
    0

    speedster239 Forum Addict
    Java Programmers

    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)
     
  3. Unread #2 - Sep 11, 2007 at 7:00 PM
  4. 1-DUB
    Joined:
    Jan 21, 2007
    Posts:
    282
    Referrals:
    0
    Sythe Gold:
    0

    1-DUB Forum Addict

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

    pretty good for a start sounds like more tuts comeing?
     
  5. Unread #3 - Sep 13, 2007 at 3:30 PM
  6. Quikuli
    Joined:
    Aug 19, 2007
    Posts:
    79
    Referrals:
    0
    Sythe Gold:
    0

    Quikuli Member
    Banned

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

    Good tutorial...
     
  7. Unread #4 - Oct 11, 2007 at 8:18 AM
  8. Monkey Mann6
    Referrals:
    0

    Monkey Mann6 Guest

    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.
     
< Need help!!! | Need help with something :S lol >

Users viewing this thread
1 guest


 
 
Adblock breaks this site