Mário Gamito wrote: > Hi, > > I'm trying to integrate some JavaScript functions in PHP, but so far, no > good :( > ... > > How can i do this ? > How to tell PHP, that def(word) is a JS function in js.php file ? > I've tried include ('js.php'), etc., but got no results :( > > Any help would be apreciated. > Well... you can easily send the Javascript function to the browser with something like: $js = file_get_contents('js.php'); echo $js; HOWEVER... there isn't really a way for PHP to use that Javascript function. PHP works on the *server* side, whereas Javascript works on the *client* side. Now back in PHP4 there was an extension for using Java with the PHP interpreter, but AFAIK that extension has not been adapted for PHP5 yet. And PHP5's object model is *closer* to the Java model. So my best guess is that whoever wrote that extension decided that it was more trouble than it was worth to get Java working within PHP5? Definitely worth your time to read this: http://php.net/manual/en/ref.java.php -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
Attachment:
signature.asc
Description: OpenPGP digital signature