Can a client view server-side PHP source code?

前端 未结 7 1821
小鲜肉
小鲜肉 2020-12-01 23:17

I\'m developing a PHP application that has to respond to request from several clients, and I thinks \"Can any of the clients see the PHP code that I\'m writing?\".

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 00:01

    One mistake for it to happen is to paste a php tag inside a php string, example:

    $string = "This is the answer: "; 
    echo $string;
    

    The person did a Ctrl+C and Ctrl+V of something that should be printed along the string, but the coder forgot to remove the php tags by distraction.

提交回复
热议问题