1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP tags, what is the difference and how important

Discussion in 'PHP' started by ScottDB, Jul 11, 2011.

  1. #1
    Hi I am working with a script that I downloaded and instead of <php? it has <?. It works and all but I saw a post on some help for this script that doesn't have support anymore. It stated that you need to put the php in it.

    Was wondeing what is the difference and why? Also do I need to go through the entire script and put them in everywhere or just at the start of the page?
     
    ScottDB, Jul 11, 2011 IP
  2. AdsMakeSense

    AdsMakeSense Active Member

    Messages:
    389
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    70
    #2
    The first is a safe open and close tag variation, the second is the so called short-open tag.
    I always use the first one as my solutioon as the second one is not always available.
    I advise to use the first option if it's possible. You could check the availability of short open tags in php.ini, at the short_open_tag.
     
    AdsMakeSense, Jul 11, 2011 IP
  3. ScottDB

    ScottDB Greenhorn

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    Thanks for the reply. I thought it might have been a security problem or something. It all seems to be working either way so I guess it is allowed in the php.ini. You know the old saying if it aint broke don't fix it. This wouldn't cause any problems with other browsers would it? Or is it just how the host reads the php.?
     
    ScottDB, Jul 11, 2011 IP
  4. ntomsheck

    ntomsheck Peon

    Messages:
    87
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The browsers wont see any of the PHP as the server translates it before it serves the page. If it works, it works. Just make sure you remember to check your php.ini file if you change servers, as I know I have short tags disabled on mine from the default install.
     
    ntomsheck, Jul 12, 2011 IP