Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Location
    Sawley
    Posts
    771
    Tokens
    1,631
    Habbo
    T0X!C-uk

    Latest Awards:

    Default PHP tutorial for total noobs :p

    Ok some of you may have read my tutorial that has been sticked for over a year :p http://www.habboxforum.com/showthread.php?p=476142 im going to write another one now but try and explain things as much as possible. Ill write a few tutorials over several weeks and then code a simple program write it up in a tutorial and hopefully from that you will learn a thing or 2 about how PHP works:

    First off what is PHP?
    the actual name is Hypertext Preprocessor but was given the abbreviation PHP because it sounded better then HPP. PHP is server side code meaning it can only be read by a server with PHP installed. If you tried to view PHP from your computer it wouldnt work unless you had PHP (and mysql if need be)installed on your computer. When a server recognises a web page contains PHP, normally by the file extension i.e. .php, the page is first sent to the PHP processor. The PHP processor then runs the PHP code, and sends the results back to the web server, either as an instruction such as to redirect the user to another page, or as standard HTML which the web server can then send to the browser. If you want to learn more about how PHP works visit www.php.net or you can PM me

    Ok you may be a little bored after reading that but you need to know your history knowing your history can get you along way in life .
    Anyways lets get to learning some PHP only this time in more detail.

    PHP Syntax
    You need to follow these rules in order to create a properly structured code. If you dont know how to use these PHP will be usless. Syntax may sound like its going to be difficult but once i have explained it will become clear and simple.
    PHP Code:
    <?php
    ?>
    Confused? Well you shouldnt be :p the above code is the opening and closing tags of PHP ALL PHP code must start and end with the above code <?php is the opening line and ?> is the closing line.

    Example:
    PHP Code:
    <?php
    echo "Visit Habblog.com :)";
    ?>
    (forget everything between the <?php and ?> as I will explain those later or you can just read my other tutorial.

    Semicolons
    Semicolons are very important when using php these are a comman script error because people forgot to use them. a Semicolon is ; if you didnt know already :p. The semicolon signifies the end of a PHP statement and should NEVER be forgotten. look at the example below everyline that says Visit Habblog.com has a Semicolon on the end.

    Example:
    PHP Code:
    <?php
    echo "Visit Habblog.com :)";
    echo 
    "Visit Habblog.com :)";
    echo 
    "Visit Habblog.com :)";
    echo 
    "Visit Habblog.com :)";
    echo 
    "Visit Habblog.com :)";
    ?>
    White Space
    White space is sometimes a big problem for someone who does not know alot about PHP. When you use a program such as Dreamweaver to code a webpage in html and you hit Enter it creates a line break automatically, if however you did this with PHP would would just create whitespace within your coding and would not change when view on a webpage. in order to create a line break in PHP you need to use the <br /> code.

    Example
    PHP Code:
    <?php
    echo 
    "visit habblog.com<br />
    visit habblog.com"
    ;
    ?>
    You may have noticed that the <br /> code is contained within the speachmarks of the code. this is important because if you did the <br /> outside of the speachmark it would not work.

    I will continue this tomorrow sometime as i need sleep :p.
    If you thought any of this was hard or confusing try looking PHP up on google see what you find it may help you understand things alot better than what i am able to explain.

  2. #2
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    1,086
    Tokens
    111

    Latest Awards:

    Default

    *reads title* woohoo something for me :eusa_danc

    lol, nice. +rep


  3. #3
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    I let Dreamweaver do all the easy tasks hence i cannot make a dj panel or even a news system
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  4. #4
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    -Visits Habblog.com- PMSL All it says Through out the Tut Lol
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

  5. #5
    Join Date
    Aug 2004
    Location
    Sawley
    Posts
    771
    Tokens
    1,631
    Habbo
    T0X!C-uk

    Latest Awards:

    Default

    Quote Originally Posted by Snoop-20
    -Visits Habblog.com- PMSL All it says Through out the Tut Lol
    couldnt think of anything else to put :p
    ill add some more shortly next up is Variables

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •