Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Adding HTML to My PHP Page

  1. #11
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    <?php is also only for PHP whereas <? can be used for other languages, I believe.
    <&#37; also works in some cases for PHP I think, though that's the same for ASP, etc.

    Twey, can you explain a bit more about:
    Code:
    <?=something()?>
    ?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  2. #12
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by djr33 View Post
    <?php is also only for PHP whereas <? can be used for other languages, I believe.
    <&#37; also works in some cases for PHP I think, though that's the same for ASP, etc.
    Well; as I said before, <? and (I haven't mentioned this yet) <% works for php if it is enabled in the php.ini file. Otherwise, those above mentioned tags will not work (with PHP that is).

    can you explain a bit more about:
    Code:
    <?=something()?>
    ?
    Code:
    <?="This is a test" ?>
    is the same as

    Code:
    <?php
    echo "This is a test"
    ?>
    Hope this helps.
    Last edited by thetestingsite; 03-15-2007 at 03:38 AM.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #13
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I get that... just like Twey's example.

    But what's up with the '='? Does it set the implied output (beyond the <?) to the value? Or does it change the meaning of the <?= tag? Would it work with <?php=, etc.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #14
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Well, I just tested this:

    Code:
    <?php="This is a test";?>
    and it didn't work.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #15
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Does it set the implied output (beyond the <?) to the value?
    No, it's just a character used in the opening tag. It has no syntactical meaning, any more than <? is related to numerical comparisons and conditionals.
    Would it work with <?php=, etc.
    No.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •