SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    BLYAT! theGWS's Avatar
    Join Date
    Jun 2001
    Location
    Melbourne, AU & Seattle, WA
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What should this script output?

    Please look at my code and tell me what should be displayed when viewed with a browser.
    Code:
    <html>
    <body>
    
    <php
    
    $counter = 1;
    
    while ($counter < 11)
    
    {
    
    	echo $counter;
    	echo " ";
    	$counter++;
    
    }
    
    ?>
    
    </body>
    </html>
    ~Dorian

  2. #2
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should echo this
    1 2 3 4 5 6 7 8 9 10
    I belive...
    - website

  3. #3
    BLYAT! theGWS's Avatar
    Join Date
    Jun 2001
    Location
    Melbourne, AU & Seattle, WA
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I expected it to do, but instead it outputs this:

    < 11) { echo $counter; echo " "; $counter++; } ?>

    Can you explain that?
    ~Dorian

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try changing:
    <php
    to
    <?php

    Then I get the result that website suggested.

    If you still get something weird, then I don't have a clue on what is going on. Sorry.

    -Helge

  5. #5
    BLYAT! theGWS's Avatar
    Join Date
    Jun 2001
    Location
    Melbourne, AU & Seattle, WA
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    $Dorian 
    "I'm helpless!";
    echo 
    $Dorian;
    ?>
    ~Dorian

  6. #6
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by theGWS
    PHP Code:
    <?php
    $Dorian 
    "I'm helpless!";
    echo 
    $Dorian;
    ?>
    ehh, what do u mean???
    it works just as he/she said if u add <?php instead of <php
    Last edited by website; Dec 6, 2002 at 06:44.
    - website

  7. #7
    BLYAT! theGWS's Avatar
    Join Date
    Jun 2001
    Location
    Melbourne, AU & Seattle, WA
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was knocking myself for not realizing I forgot something as simple as a ?.

    It worked once I inserted it. Thanks.
    ~Dorian

  8. #8
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by website
    as he&she said if u add <?php instead of <php
    Am I a "dual person"?

    -(he)Helge

  9. #9
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh, yes, didn't u know???





    btw, & is next to / in my keyboard.
    - website

  10. #10
    SitePoint Evangelist
    Join Date
    Nov 2001
    Location
    UK
    Posts
    466
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by website
    btw, & is next to / in my keyboard.
    That's just being silly now.

    Everyone knows & is [shift] 7

    Suggestion: take your keyboard back and ask for a proper one
    teckis - that's news to me.

  11. #11
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I live in iceland and my keyboard is very ****ed up... (Here we have 32 letters)
    - website


Bookmarks

Posting Permissions

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