Forum Moderators: coopster

Message Too Old, No Replies

Javascript to PHP?

         

Code Sentinel

2:37 pm on May 24, 2004 (gmt 0)

10+ Year Member



Are there any PHP scripts that can process and read the output of javascript?

I know JS is a client side thing, but I'd like to load the output of an external script into a database or cache it locally for quicker display.

StupidScript

5:05 pm on May 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you give a more detailed example of what you wish to do? Do you want to use forms to capture info? Are you talking about environmental variables? User behavior tracking and content manipulation?

As long as you can send variables back to the server, PHP can do something with them with the next request delivery. During the posting to the server, and when PHP is doing its thing AT the server, you can stick a little MySQL interaction in there.

Pass variables to PHP by modifying/writing a cookie or by including the variables in the URL (?id=01&sub=2).

PHP can't dynamically change an already-loaded page, like Javascript can. Likewise, Javascript in its client-side invocation cannot alter page code before it is received by the client, as you may well know.

ergophobe

5:11 pm on May 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Server-side Javascript, perhaps? I don't know anything about it, but it sure seems that you would need to start there. Like I said, I'm speaking form nearly total ignorance though.

You can peruse the server-side javascript guide [javeriana.edu.co] (also available here [developer.netscape.com] for version 1.2) and reference [docs.sun.com] (version 1.2 here [developer.netscape.com]). Perhaps start with a brief overview [xoology.com] and [url=]tutlorial[/url].