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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    May 2005
    Location
    united kingdom
    Posts
    8,084
    Tokens
    595

    Latest Awards:

    Default Help with PHP? +REP!

    ok, I am currently learning PHP on w3schools however I have entered what I want into a PHP file called index.php and opened in Mozilla Firefox

    here's my code:

    PHP Code:
    <HTML>
    <HEAD>
    <title>PHP Test File</title>
    <style type="text/css">
    <!--
    body {background: #6699cc;}
    -->
    </style>
    </head>

    <body>
    <?php 
    $txt
    ="BLOB";

    echo  
    $txt to you;?>


    </body>
    </html>
    and here's the one on the w3schools:

    PHP Code:
    <html>
    <body> <?php
    $txt
    ="Hello World";
    echo 
    $txt;
    ?> </body>
    </html>
    both of which when I open in Mozilla Firefox show nothing, what do I do?
    Last edited by myke; 13-01-2007 at 04:53 PM.

    drink up this bottle of yeah
    and P A I N T your body on me


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

    Latest Awards:

    Default

    could be because you have installed php on you pc. Its a server side language not client side so therefore needs to run on a machine with php installed..

  3. #3
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Same thing that I said to him on MSN. I walked him through setting up and using EasyPHP, so he's good now



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  4. #4
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Just for reference to any other people who view this:

    You need some kind of server software (e.g Apache with PHP or IIS with PHP) to run PHP scripts. The server parses the PHP and returns HTML to the browser (e.g Firefox/Internet Explorer). The browser does not actually parse/run the PHP.

  5. #5
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    693
    Tokens
    0

    Default

    *Jumps in*

    Also, you can't echo a variable and string without quotes, it returns a parse error
    PHP Code:
    $txt="BLOB";

    echo  
    $txt to you
    Should be either.
    PHP Code:
    $txt="BLOB to you";

    echo  
    $txt;
    # Or
    $txt="BLOB";

    echo  
    "{$txt} to you"
    XHTML, CSS, AJAX, JS, php, MySQL.

    --

    HxF moderators can't read timestamps.

  6. #6
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <HTML>
    <HEAD>
    <title>PHP Test File</title>
    <style type="text/css">
    <!--
    body {background: #6699cc;}
    -->
    </style>
    </head>

    <body>
    <?
    $txt 
    "BLOB";
    echo  
    "$txt to you";
    ?>
    </body>
    </html>
    And are you saving it as .php and not .htm/.html?

    Kevin

  7. #7
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Heinous View Post
    *Jumps in*

    Also, you can't echo a variable and string without quotes, it returns a parse error
    PHP Code:
    $txt="BLOB";

    echo  
    $txt to you
    Should be either.
    PHP Code:
    $txt="BLOB to you";

    echo  
    $txt;
    # Or
    $txt="BLOB";

    echo  
    "{$txt} to you"
    Or even better idea:

    Replace:

    PHP Code:
     echo  "{$txt} to you"
    With:
    PHP Code:
      echo  '$txt to you'

  8. #8
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    But if its not showing up.. if should error something.. its just blank.

    I think he is saving it as .html

  9. #9
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by Tomm View Post
    Or even better idea:

    Replace:

    PHP Code:
     echo  "{$txt} to you"
    With:
    PHP Code:
      echo  '$txt to you'
    i find it cleaer just to seperate them more visually in code highlighting terms
    PHP Code:
     echo  $txt." to you"

    ps. Check the sourse, is the php actualy showing in the sourse code? if so you ether dont have php installed or are useing the wrong exstention
    Last edited by Mentor; 14-01-2007 at 07:48 PM.

  10. #10
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    I think Carl he isnt saving the write extension

Page 1 of 2 12 LastLast

Posting Permissions

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