SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2010
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    enabling some unfurnished code in php.....

    Hi There,

    I am new in php, and I got some code to be work on....

    Now that person coded something like that

    PHP Code:
    <?
    //php code

    ?>
    //for Printing
    <?=?>
    When I run this to my localhost, it does not recognize these type of coding until i do <?php ?> and <?php echo ?>

    Please let me know how to enable this in my WAMPSERVER php INI....

    Thanks in advance
    Danish'

  2. #2
    SitePoint Mentor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,257
    Mentioned
    32 Post(s)
    Tagged
    5 Thread(s)
    Hi Danish,

    In your php.ini file, search for short_open_tag and make sure it's enabled:
    Code:
    short_open_tag = On
    I've always avoided using short tags in my code, as you can't guarantee that they will be enabled in every environment where your code is run, but apparently the short echo tag (<?= ?>) is permanently enabled from PHP 5.4 onwards.

    Edit: Don't forget to restart Wamp server after editing php.ini.


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
  •