|
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]
|