Attaching Header to the HTML Pages.

Arwany

New Member
Dear Experts and members,

I have almost 3000 HTML static pages, and I have them uploaded to my website under /www/website folder in linux hosting.

I want to add an advertisement banner at the top of each page loading form the server.

I tried to search online for a solution, but didn't find any.

Is there any way that I can do that, I just need to attach a banner at the top of each page loading, just like top-frame refer to a page that contain my banner html code, or even Javascript code.

I have an idea (from my general study) that it can be done by SSI.


I am a web developer in Windows, and that can be done easily in IIS, but in linux I have no experience.

Thanks for your help and time !


Ammar
 

jnjc

New Member
I'm not sure how you'd go about doing this. If the host is linux then most likely you webserver software is apache, maybe look in an apache forum for some answers...
 

mezangath

New Member
I think you should consider PHP instead. HTML are static pages, you'll have to use javascript solutions for the functions you seek in HTML
 

Arwany

New Member
Thank you jnjc, Thank you mezangath.

I understand everything related to converting to PHP.
(I am a Web Programmer).

But they are too much pages, and can't imagine that I have to edit all of them one by one.

I hope that someone could help me out in this.


I would appreciate anyone who could help me in this.
 

jnjc

New Member
But they are too much pages, and can't imagine that I have to edit all of them one by one.

That's why I recommended looking to get apache (or whatever web server you use) to do it.

Another solution would be to write a program to read in each .html page and re-write it including a link to a new .js file in it. Have the program read all files in directory a. When it reads a file have it create a new file of the same name in directory b and line by line put the contents of the original file into the new file, as it goes through the file have it insert a line that calls a js script after it reads the <head> tag in the original file.

HTH,
JC
 
Hi,
Description:void header ( string $string [, bool $replace= true [, int $http_response_code ]] )
header() is used to send a raw HTTP header. See the » HTTP/1.1 specification for more information on HTTP headers.
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
<html>
<?php
/* This will give an error. Note the output
* above, which is before the header() call */
header('Location: [example.com/');
?>
 
Top