Advanced Search

Results 1 to 6 of 6

Thread: <? instead of <?php

  1. #1
    Join Date
    Feb 2009
    Posts
    156
    Thanks
    0
    Thanked 4 Times in 3 Posts

    Default <? instead of <?php

    my WAMP does not support <? tag
    i have to write <?php instead of <?
    so i am unable to reun the scripts which contains <? tag
    i herad about it to make changes in php.ini to support <? tag..
    if any1 know plz help
    thnaks in advance

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    262
    Thanked 690 Times in 678 Posts

    Default

    There are three possible tags for PHP code:
    <?php .... ?>
    <? ..... ?>
    <% .... %>

    The last one is especially bad: it is confusing compared to ASP (and others?).

    While <?....?> can work, I don't recommend it: it's less clear and not supported by all hosts. It's a much better idea to fix the code than to patch the server.

    There's also the option of a special syntax for echoing variables:
    <?=$variable?> which is like <?php echo $variable; ?>
    This is, again, a bad idea for the same reasons as above.


    If you want to change the server, though, look here:
    http://php.net/manual/en/ini.core.php

    The term you want to search for on google (if you need more info) is "php short tags".
    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

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,629
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    To further what daniel says, I would recommend changing the tags, not your php.ini. You can do a search-and-replace with any good text editor.
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  4. #4
    Join Date
    Feb 2009
    Posts
    156
    Thanks
    0
    Thanked 4 Times in 3 Posts

    Default

    Quote Originally Posted by traq View Post
    To further what daniel says, I would recommend changing the tags, not your php.ini. You can do a search-and-replace with any good text editor.
    i agree
    but i want ot learn the way of php.ini

  5. #5
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    It's called short_tags I believe. A simple "false" to "true" or "0" to "1" should fix this problem in php.ini
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    262
    Thanked 690 Times in 678 Posts

    Default

    That is correct, but the other forms may be enabled by different settings. The link in my post above explains it all.
    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

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
  •