Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

add script to file

i would like to know how i can add a script to every page in my site like in geocities where the pop up window is added
0
chongkong
Asked:
chongkong
  • 3
1 Solution
 
alamoCommented:
I think they got rid of that, it was too annoying. Anyway, it was done with Javascript, not perl - they have set up their server so every page has their own header and footer html added, and in their footer (i think) they added javascript that popped up the new window.

0
 
chongkongAuthor Commented:
what i mean is how i can add the footer html to every page without typing it myself.
0
 
alamoCommented:
The easiest way would be if your server supported it, turn it on as a server option. Next easiest would be to use server-side includes (or .asp), putting a line at the end of every document to include a common file (or run a script to generate the footer).

After that it gets tougher. If your footer changes periodically but not all the time, then the best way (because it doesn't need CGI) is a perl script that modifies all your pages to add the header. If you want the footer to be dynamic, then you would need to have all your pages served via a CGI. That would impact performance, so for any sort of heavy use you'd want to program the CGI in C or at least something other than perl. The CGI would get the file the user was requesting, and add the footer at the end.
0
 
alamoCommented:
Next time please reject my answer if you don't like it, what you did was insulting and uncalled for on a 10 point question.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now