Not entirely true.  Javascript is directly linked to HTML and HTML is
directly linked to PHP so you can have PHP talk to Javascript through
So here's a very simple example of a Javascript and PHP script (on
separate servers) talking to one other...
            <script language=javascript>
            if (
                        // Parse and evalulate the returning GET string.
                        var urlStr =;
                        var name = urlStr.split('=')[0];
                        var value = urlStr.split('=')[1];
$origin = $HTTP_REFERER;
if ($request == ‘current_time’)
            $information = time(); // err.. whatever the time function
is in PHP
            header("Location: $origin?return=$information");
In this example the Javascript is activated when the page is visited.
If no information is being passed in the URL string then it
auto-redirects to a PHP script on another server.  The PHP script
extracts the variables from the GET string and redirects back to the
originating script with the requested information.  Now when the
Javascript reads it it’ll parse out the value and write it to the screen
closing the loop.  Pretty slick eh?
-----Original Message-----
From: Alexander Skwar [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 19, 2002 12:54 PM
To: Marcel Besancon
Subject: Re: [PHP] Calling Javascript-function from php-script ...
»Marcel Besancon« sagte am 2002-03-19 um 13:04:38 +0100 :
> Hi everybody,
>     is there someone who can tell me how to call a javascript-function
by a
> php-script.
PHP creates HTML pages (mostly) which will be displayed by a client
and/or receives send pages/requests from a client.
There's no connection between the two.
Alexander Skwar
How to quote: (german)
Homepage:      |     Jabber:
[EMAIL PROTECTED] - Die günstige Art an Linux Distributionen zu kommen
                       Uptime: 2 days 8 hours 46 minutes
PHP General Mailing List (
To unsubscribe, visit:

Reply via email to