Reply to Re: Use php variable in javascript function

Your name:

Reply:


Posted by countach on 10/19/06 10:29

You have to keep in your mind that, in fact, PHP only mission is to 'paint'
the data that travel to the user browser.

Knowin' that, you can 'send' html, javascritp, css... plain text, or what
ever you want. Then the browser will treat is exactly as if it were reading
a normal .html file for example.


En las nuevas, el emilia.woo@gmail.com escribi�:
> Oh, I find out!.
> it's just
>
> <input type="button" onclick="practice( '<? echo $ex; ?>' ); ">
>
> right?
>
> emilia.woo@gmail.com wrote:
>> Hello guys.
>> I have a question about js function and php variables.
>>
>> I want to use php variables in javascript function. For example,
>>
>>
>> <?php
>> $ex=(int)$_POST['Example'];
>>>
>>
>> $ex value is 3
>>
>> There's js function named "practice"
>> I want to run
>>
>> <input type="button" onclick="practice(3); ">
>>
>> in this case, 3 is $ex. However, I cannot use like this:
>>
>> <input type="button" onclick="practice( <? $ex ?> ); ">
>>
>> How can I use php variables in javascript function? Thank you.

[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

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