Re: could i get a clue?
| From: | Richard Lynch | Date: | Wed, 15 Aug 2001 03:18:56 +0000 |
| Subject: | Re: could i get a clue? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62756@lists.php.net to get a copy of this message | ||
> 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 richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
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