1

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.

    1
    • 3
      Make sure you're escaping your code by indenting it 4 spaces or wrapping it with back ticks
      – user229044
      Dec 1, 2010 at 15:14

    1 Answer 1

    1

    Indent 4 spaces, as defined in

    https://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
    2
    • 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, 2010 at 7:42
    • @choseal HTML is allowed here Dec 2, 2010 at 8:28

    You must log in to answer this question.

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