You are here: Re: Java Script and PHP « PHP Programming Language « IT news, forums, messages
Re: Java Script and PHP

Posted by Jonas Werres on 12/23/07 13:43

> Or save a file named myscript.js.php. In the file you can use both
> javascript and php. For example, you can write:
>
> alert( <?php 12 + 15 ?> )
>
> and then include it in your html with:
>
> <script type="text/javascript" language="JavaScript"
> src="myscript.js.php"></script>
>
> --
> www.panoye.com :: virtual tour

This will be send with the wrong Header (normally text/html). You have
to add
header('Content-type: application/x-javascript');

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация