Superimpose images on php webpages
July 26, 2005 1:14 AM Subscribe
I do websites. I'm looking for a PHP/Javascript script that superimposes a link or image to webpages that are below a certain directory on the server. Any geeks with ideas?
do you want a link to show up on pages that are within a certain dir?
posted by lemonfridge at 4:04 AM on July 26, 2005
posted by lemonfridge at 4:04 AM on July 26, 2005
Response by poster: Yes, a kind of watermark. Essentially, I have a lot of different scripts and content for different things, but I want it all to tie up to the "portal" page. The only way I can think to get the link on all scripts without having to delve into the code on each one is to specify that this "watermark" appears on all pages below a certain directory level.
posted by wibbler at 4:34 AM on July 26, 2005
posted by wibbler at 4:34 AM on July 26, 2005
Best answer: Would a header or footer on all pages below a certain directory suffice?
If you're on linux you could add these lines to an .htaccess file in the directory for which headers and footers should be shown
php_value auto_prepend_file "header.php"
php_value auto_append_file "footer.php"
The first line adds a header to every page, the second adds a footer. You don't need both lines if you only want a header or a footer.
posted by null terminated at 5:58 AM on July 26, 2005
If you're on linux you could add these lines to an .htaccess file in the directory for which headers and footers should be shown
php_value auto_prepend_file "header.php"
php_value auto_append_file "footer.php"
The first line adds a header to every page, the second adds a footer. You don't need both lines if you only want a header or a footer.
posted by null terminated at 5:58 AM on July 26, 2005
So you have a large number of diverse existing pages and you'd like to add a common navigational element to all of them without editing the actual files themselves. What I'd do: Use MOD_REWRITE to redirect requests to any pages in the specified directories to a PHP script that would read out the file to the browser until it hit "<body>" after which it would add HTML (with inline styles) for a small header bar containig appropriate links, and then continue reading out the rest of the file.
This should work unless the pages in question use absolute positioning.
posted by Nothing at 6:04 AM on July 26, 2005
This should work unless the pages in question use absolute positioning.
posted by Nothing at 6:04 AM on July 26, 2005
This thread is closed to new comments.
I'm guessing that you're looking for a script that examines the current URL, checks to see if it's within the special directory, and if so, then does the watermark thing. Is this the right idea?
posted by chrismear at 3:57 AM on July 26, 2005