SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Jul 2005
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple Question...

    Hi All,

    In PHP4, this statement worked for me: <? XXX ?> but it does not work in php5.

    So is that true that in Php5, you must have <?PHP XXX ?>

    Thanks.

  2. #2
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a configuration option called short_tags. It can be set either way.

  3. #3
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    See http://us2.php.net/ini.core for more information. It's called short_open_tag, actually.

  4. #4
    SitePoint Addict
    Join Date
    Jul 2005
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much. Appriciate it. I guess besides learning PHP Language, also need to learn more about PHP Programming (configuration) as well.

    Once again, thanks.

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could have the same problem on php4, as mentioned above its a setting which must be enabled.

    its recomended you dont use short tags, because when its not enabled, your php source code will be shown to the browser as plain text. this is not good. even if the setting is enabled today, what happens if your host disables it tomorow?


    seems like a silly risk to take to avoid having to type a few extra chatacters.


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
  •