Follow Habbox on Twitter!
Or "X", if you must. Anyway, follow us for Habbo news and competitions!
Join the Habbox team!
Come and join our friendly community as part of the staff team! One of us... one of us...
Check out HabboxWiki!
The biggest and best archive of all things Habbo - could YOU be our next top editor?


Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2005
    Location
    Manchester
    Posts
    3,187
    Tokens
    0

    Latest Awards:

    Default || PHP - Very Basic ||

    Ok firstly i'm not a PHP expert, i'm just writing down a few codes i know that may help you in somepoints of your websites.

    PHP Code:

    <?php
    echo "Hello Habbox!";
    ?>
    The echo bit is what will show in your browser.

    PHP Code:

    <?php
    if( $lang == )
    {
        echo 
    "Hello Habbox!";
    }
    ?>
    Well know were using a Variable we can tell this by the $ so it's more a less the same.

    IP Addresses.

    PHP Code:

    <?
    $log_file 
    "ipsthathavebeenlogged.txt"// This is the files the IPs are logged in.
    $ip getenv(\'REMOTE_ADDR\');
    $fp = fopen("$log_file", "a");
    fputs($fp, "$iprn");
    flock($fp, 3);
    fclose($fp);
    PRINT("your IP has been logged.....$ip");
    // "your IP has been logged....." .
    ?>
    Firstly we create a .txt file named whatever name you want

    Then add this code in notepad and add it to your page then you need to change

    PHP Code:

    $log_file 
    "ipsthathavebeenlogged.txt"// 
    bit to what your IP's files going to be.

    Don't forget to CHMOD your text file to 666

    With me so far? Hope so.

    PHP Includes

    PHP Code:
    <?
    include ('phppage.php');
    ?>
    As i say just basic PHP codes that i've used some times, i'll put more PHP tutorials on here as i get more knowledge.

    - Dan

  2. #2
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    cool although
    PHP Code:
    <?php
    if( $lang == )
    {
        echo 
    "Hello Habbox!";
    }
    ?>
    would only show in your browser if you set the variable $lang to 1 or in the url put index.php?lang=1 etc..

  3. #3
    Join Date
    Jun 2005
    Location
    Manchester
    Posts
    3,187
    Tokens
    0

    Latest Awards:

    Default

    Yeah, i forgot to mention that "/

    - Dan

Posting Permissions

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