Not only that, but Bob, PHP is a *server-side* language. That means that
all computing is done on the server before ever even being sent to the
user. You can't call PHP on the fly -- it's done when the user requests
the file, and then the resulting HTML is what the user gets. On the other
hand, JavaScript is a CLIENT-SIDE language, meaning it doesn't do anything
on the server, it simply manipulates the HTML that the user has already
gotten. You can have PHP affect the script on the resulting page the user
gets before the page is sent, but you can't have JavaScript to anything
with PHP, besides opening or redirecting to a new PHP page with particular
parameters.
For example, in terms of PHP affecting JavaScript.. I created an image
database where users can upload images, and when they do the file info
(file name, description, file size, image width, image height, file type)
are stored in the database. When the users go to browse the images, there
is JavaScript code which PHP dynamically populates with all of the image
data, so that the users can preview all of the images and their info
without reloading the page. That's an example of PHP influencing the
resulting JavaScript. But JavaScript can't affect PHP, because the PHP is
all computed on the server side before ever reaching the user, whereas
JavaScript is executed on the user's side.
Hope that clears things up.
-Mike
At 11:32 AM 5/10/01 +1000, Ignatius Teo wrote:
>Wouldn't it be simpler to have your PHP function in a discrete script file
>and call:
>
><a href="javascript:void(0)" onClick="NewWindow('myscript.php');
>return false"></a>
>
>Put on your thinking caps.
Today's alienated gem:
"Send your favorite mom lots of love and affection, free of shipping
charges!" -- Seen on a shopping site
-=- Mike Flynn - Burlington, VT -=-
[EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood *
Wouldn't the free market, in its true form, be anarchy?
--
PHP Windows 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]