Reply to Re: Java Script and PHP

Your name:

Reply:


Posted by puzz on 12/23/07 13:24

macca wrote:
> PHP is server side and is converted to HTML by the time it reaches the
> client (browser). JavaScript is client side and is interpreted by the
> client (browser) on the other side.
>
> Thus, you can write javascript with PHP but you cant write PHP with
> javascript.
>
> e.g.
>
> <?php
>
> echo '<script type="text/javascript">alert("javascript alert")</
> script>';
>
>
> ?>

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

[Back to original 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

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