Reply to Re: How to return a file

Your name:

Reply:


Posted by clashers5@gmail.com on 10/17/06 03:03

Yes.
Put the foo.js text in the bar.php file or read it from a database or
text file and have php spit it out. Whatever suits your fancy.

Then, when bar.php receives the query string variable file with the
value foo, have it first print the type of the output with this code:

header('Content-type: text/javascript');

and then have it print the contents of foo.js (whereever you may have
stored them)

HTH
-Joe

On Oct 16, 10:41 pm, "Bryan" <BTRichard...@gmail.com> wrote:
> Hello all,
>
> In some html code I have the following:
>
> <script type='text/javascript' src='foo.js'></script>
>
> However, I'd like to replace 'foo.js' with something like
> "bar.php?file=foo" and have bar.php echo foo.js back to the script
> element. Is this possible?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация