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 7 of 7

Thread: PHP Help [Rep]

  1. #1
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default PHP Help [Rep]

    If i had a code saying

    PHP Code:
    <?php
    echo "Start<br>"
    $start 1
    $end 
    10
    echo "End<br>"
    ?>
    How would i make it echo

    Start
    Number 1
    Number 2
    Number 3
    Number 4
    Number 5
    Number 6
    Number 7
    Number 8
    Number 9
    Number 10
    End
    Lets set the stage on fire, and hollywood will be jealous.

  2. #2
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    <?php

    while($start == '1' && $end == '10' && $num == '0') {
    if($start != '0')
    echo "Start"
    $start - 1;
    } else {
    if($end != '0') {
    $num + 1;
    echo "Number";
    echo " ";
    echo $num;
    echo "<br />;
    }
    else {
    echo "End";
    }
    ?>

    Something along the lines of that..
    How could this hapen to meeeeeeeeeeeeeee?lol.

  3. #3
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    It says

    Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/tom743/public_html/count.php on line 6
    But thanks anyway +Rep
    Lets set the stage on fire, and hollywood will be jealous.

  4. #4
    Join Date
    Mar 2008
    Posts
    173
    Tokens
    0

    Default

    Reconix.. that is a stupid way to do that.

    PHP Code:
    <?php
    echo "Start <br />";
    for(
    $i 1$i <= 10$i++) {
        echo 
    "Number $i <br />";
    }
    ?>

  5. #5
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Navicat View Post
    Reconix.. that is a stupid way to do that.

    PHP Code:
    <?php
    echo "Start <br />";
    for(
    $i 1$i <= 10$i++) {
        echo 
    "Number $i <br />";
    }
    ?>
    It worked Thanks +Rep
    Lets set the stage on fire, and hollywood will be jealous.

  6. #6
    Join Date
    Mar 2008
    Posts
    173
    Tokens
    0

    Default

    No problem, thanks

  7. #7
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    That made me laugh in all honesty... LOL

    Result:
    Code:
    Start
    Number 1
    Number 2
    Number 3
    Number 4
    Number 5
    Number 6
    Number 7
    Number 8
    Number 9
    Number 10
    End
    PHP Code:
    <?
    ## "Shouts" Start
    echo("Start<br>");

    ## State its 1.
    $n 1;

    ## while, when N more than 11 (10)
    while($n 11
    {

    ## "Shouts" Number and the result.
    echo("Number ".$n."<br>");

    ## Increments each time
    $n $n 1;

    }

    ## "Shouts" End
    echo("End<br>");
    ?>
    I commented it for you.
    Hi, names James. I am a web developer.

Posting Permissions

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