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.

I am facing a problem on <? and <?php in wamp5

Discussion in 'PHP' started by Subikar, Feb 20, 2008.

  1. #1
    If I write php code
    <?php

    Then my php code

    ?>

    It is running fine

    But when I am trying with
    <?
    Then my php code
    ?>

    Php is not running. I know there I need to change some setting in php.ini.

    But I don't know where and what I have to write there.

    PLs help me asap.
    I am facing lots of problem with this.

    Thanks,
    Subikar
     
    Subikar, Feb 20, 2008 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    1.
    quote from my PHP.ini

    2.
    the setting is in your system's php.ini

    normal would be
    short_open_tag = Off

    if you really want to use short tags then apparently you would have to

    short_open_tag = On
     
    hans, Feb 20, 2008 IP
    Subikar likes this.
  3. Subikar

    Subikar Active Member

    Messages:
    241
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks a lots Hans. :)
     
    Subikar, Feb 20, 2008 IP
  4. mvl

    mvl Peon

    Messages:
    147
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    For security it is always a good idea to use long open tags :

    
    <?php
    
       ....
    
    PHP:
    Long open tags always work, short open tags only when configured.
    Your code might work now with short open tags, but suppose your hoster changes the server settings. Your PHP will not be executed, but exposed to the outside world because the source will be served like a text page.

    Imho using short open tags means taking unnecessary risks.
     
    mvl, Feb 20, 2008 IP