I am not sure exactly what you are doing, but the thing
to remember is that your PHP script is writing your HTML
and JavaScript.  As long as you keep that in mind it is
fairly easy to see how to pass variables to JS.

Here is a very simple example

<?php $foo = "bar"; ?>
<Script language=Javascript>
var foo = "<?php echo "$foo"; ?>";

If you need something more specific post some code.

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company

----- Original Message -----
From: Karl Phillipson <[EMAIL PROTECTED]>
Sent: Friday, July 27, 2001 6:08 AM
Subject: [PHP] php and javascript

> Does anyone know how to pass php variables to a javascript for processing.
> I have a DHTML menu system that requires variables be attached to the url
> contained within it. Using echo does not print the variable to the url.
> Is there another way?
> Thx in advance.
> Karl
> ==========================
> Karl Phillipson
> PHP SQL Programmer
> Saffron Hill Ventures
> 67 Clerkenwell Road
> London
> EC1R 5BL
> ==========================

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]

Reply via email to