What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

Hi there,

A little while ago I wanted to help someone correct his/her code by posting a piece of code with an echo in it. To my suprise, only the text that the code was supposed to echo appeared in my post:

  • View Companies
  • <li><a href="<?php echo base_url().'company/view'; ?>">View Companies</a></li>
    

    I'm just wondering if this is supposed to happen? -is it part of the security, or so you can provide a real-life example? (bug or feature?)

    Just thought I'd ask, because I couldn't find a topic about it, sorry.

    share|improve this question
    3  
    Make sure you're escaping your code by indenting it 4 spaces or wrapping it with back ticks –  meagar Dec 1 '10 at 15:14

    1 Answer 1

    Indent 4 spaces, as defined in

    http://meta.stackoverflow.com/editing-help

    which is linked from

    • the small [?] to the upper right of every edit area
    • the "full reference >> " link in the sidebar of any ask or edit page
    • the /faq
    share|improve this answer
        
    I'm sorry, I guess my question was a little vague. What I meant to ask, is if it's normal that the site accepts php scripts as actual scripts unless you use back ticks or 4 spaces. But I guess it is, to some extent. –  Choseal Dec 2 '10 at 7:42
        
    @choseal HTML is allowed here –  Jeff Atwood Dec 2 '10 at 8:28

    You must log in to answer this question.

    Not the answer you're looking for? Browse other questions tagged .