How to execute PHP code from within javascript escape/unescape ?

Posted by Karthik on Stack Overflow See other posts from Stack Overflow or by Karthik
Published on 2010-05-15T00:36:16Z Indexed on 2010/05/15 0:44 UTC
Read the original article Hit count: 569

Filed under:
|
 <Script Language='Javascript'> <!-- document.write(unescape('<?php if ( ! defined('PROJECTNAME')) exit(''); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   </body> </html> ')); //--> </Script>

I did not copy paste the whole code. There is more PHP code within the javascript. How to make the browser understand that the php code is php and not treat it as a part of a html code?

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript