RE: [PHP-WIN] Javascript & PHP...

From: Date: Tue, 05 Sep 2000 15:43:53 +0000
Subject: RE: [PHP-WIN] Javascript & PHP...
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2429@lists.php.net to get a copy of this message
That is exactly what I am after - thanks! -----Original Message----- From: Andy Hoffman [mailto:andy.hoffman@bms.com] Sent: Tuesday, September 05, 2000 03:04 To: Mikey Cc: php-list Subject: Re: [PHP-WIN] Javascript & PHP... Mikey wrote: > I want to pass PHP values into an external JavaScript source file. I am > guessing that all I need to do is add .js to the to the list of AddType > directives, however, is there anyone who has tried to do this before an can > share a little wisdom before I go too far down this road... Mikey, Not sure if this is EXACTLY what you're looking for, but I do something similar w/ PHP4. Basically, I don't pass php values out to the javascript source, BUT I have my php-script output valid javascript back to the browser... Instead of returning a full set of HTML headers, body, etc., I simply return a bunch of document.write() tags and function code (if that's what would normally be in the .js file) I make my php script output look exactly like the relevant Javascript source file. Then, when including this php-script in plain HTML pages, I simply add the line (just like regular javascript client-side includes): <script language="Javascript" src="myscriptgenerator.php3"></script> To the browser, the php script result looks EXACTLY like a pre-existing javascript sourcefile, but on the server-end, this source is dynamically generated. Hope that helps a bit. -- Andy Hoffman Web Developer Bristol-Myers Squibb email: andy.hoffman@bms.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#2429) next »