icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » The complete basics of PHP Tutorial 1

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old September 17th, 2004, 10:32 AM   #1 (permalink)
Registered User
Fresh Surpasser
 
moitio's Avatar
 
Joined in Jul 2004
Lives in Stockport, UK
Hosted on Serva
4 posts
Gave thanks: 0
Thanked 0 times
The complete basics of PHP Tutorial 1

This tutorial is based on teaching you the absolute basics of PHP code. It will show the structure of a PHP script

PHP Code:
<? //escapes the HTML document

//this is a comment and won't be parsed by the php
/* 
this
is 
also 

comment 
*/

$variablename "hello world"//sets the variable: variablename to "hello world"

if($foo == "fee"){     //checks if the variable "foo" is set as "fee"
echo("hello world");  //prints hello world to the document IF "foo" equals "fee"
//closes if statement
else{ //opens else statement 
echo("goodbye world"); //prints hello world to the document if "foo" DOES NOT equals "fee"
//closes if statement

echo("hello world");  //prints hello world

//below: goes back to the HTML document
?>
This shows the basic structure of what a PHP code looks like.
PHP uses many different functions such as print, write, echo, and many many more, all of which can be found at http://uk2.php.net/quickref. Or if you have a function name just type in: http://www.php.net/(functionname)

Don't be frightened by all these functions. I'd be brain dead to say I knew each and every single one of them. I know the ones I use alot and if I ever need to use a different one, I just look it up.

This is quite alot of information, I understand, but take a long look at each bit, and learn what everything does.

I will be posting my next one in about a week about variables
moitio is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On