Reply to Re: To pass a PHP variable to javascript

Your name:

Reply:


Posted by Pablito on 10/17/84 11:38

"jamen" <jamen@invalid> ha scritto nel messaggio
news:43dcc9ca$0$2086$edfadb0f@dtext02.news.tele.dk...
> Pablito wrote:
> > can I pass a $var maked with PHP to javascript
>
> of course..
>
> <script type="text/javascript">
>
> var jsvar = <?php echo $phpvar ?>;
>
> </script>

I thank you very much but my script is this and it is like your but do not
work
Why?


<?php
$cont=fopen('cont.txt','r');
$incr=fgets($cont);
//echo $incr;
$incr++;
fclose($cont);
$cont=fopen('cont.txt','w');
fwrite($cont,$incr);
fclose($cont);
echo "<script type="text/javascript">
var incr=$incr
</script>";
?>

Pablito

[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

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