[PHP] RE: could i get a clue?
No sure how you mean 'calling' the script... but in addition to using something like document.location='myscript.php' It would theoretically be possible to pass javascript variables to a PHP script in the same way by using something like var foo = Some Text; var bar = Some other text; document.location = 'myscript.php?foo=' + foo + 'bar=' + bar; And although it's not exactly 'calling' a script from Javascript, you can use PHP to generate your script on the fly... handy if you need to do something with data from a database within a Javascript. (Not sure what that would be, but it might come in handy.) -Andy -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 14, 2001 8:19 PM To: [EMAIL PROTECTED] Subject: Re: could i get a clue? ok a basic question. perhaps I dont know enough about javascript but anyway.. I want to call a php script from javascript. Anybody have any hints for me? A link to a useful website would work as well. thanks mates -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: could i get a clue?
Sorry I wasn't very clear on what I needed to be done by javascript and php. basically i have a flash movie that calls a javascript function and I was wondering if I could do something in javascript like: var x = bleh.php; and get some variables back but I soon learned that I could do this from within flash itself. thanks for all the help though. I find the other stuff useful for perhaps another project. ciao -student of computer science Marilyn Manson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ok a basic question. perhaps I dont know enough about javascript but anyway.. I want to call a php script from javascript. Anybody have any hints for me? A link to a useful website would work as well. thanks mates -student of computer science -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: could i get a clue?
Marilyn Manson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ok a basic question. perhaps I dont know enough about javascript but anyway.. I want to call a php script from javascript. Anybody have any hints for me? Well, to call a php script, you basically have to request a new file. If you just need to submit information, you can preload a new 'image' with parameters. If you need to get information back, you pretty much have to devote a frame to it somewhere - either a visible frame, where the script actually returns an updated page, or an invisible frame (ie one pixel high with a 10-pixel top margin) in the same window, or a new minimized window. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: could i get a clue?
ok a basic question. perhaps I dont know enough about javascript but anyway.. I want to call a php script from javascript. Anybody have any hints for me? A link to a useful website would work as well. thanks mates You first need to realize that this will *require* opening up a whole new connection to the server, which can be rather slow... PHP lives on the web-server, JavaScript lives in the browser, and the PHP that generated your current JavaScript is long gone by the time the JavaScript runs. That said, you could do any of: document.location = http://yourserver.com/whatever.php;; Also, almost for sure, JavaScript has some way of asking a web-server to respond to a GET or POST. Search your fave JavaScript site for functions named GET and POST, and see what you get. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]