Web Hosting Talk







View Full Version : auto insert?


Akash
08-19-2002, 01:32 PM
let's say I have a dedicated server or VDS/VPS....is there any way to automatically insert html code into .*htm* files as they are uploaded via FTP or loaded into the clients browser???

Paul_9cy
08-19-2002, 01:41 PM
Sounds more like a coding question I don't quite understand what your aiming at.... .Do you mean like dynamic content where a file is inserted into the html files ? You could do it with php pretty easily but you need to use .phtm/.phtml files

<?
include("includes/header.inc");
$i=strrpos($PHP_SELF,".");
include("content/" . substr($PHP_SELF,1,$i-1) . ".inc");
include("includes/footer.inc");
?>


That code will allow you to have any file named .inc in the /content dir to be auto inserted into the corisponding .phtml in the root directory...

I.E index.phtml file has that it calls on the /content/index.inc file for information to be inserted......

Also this includes header/footer so you can put your design etc into them ..


Hope this helps But I think this should be in a different forum.

Akash
08-19-2002, 02:14 PM
no i know how to do it that way, but what i want to do is have the server insert html code into html files as they are either uploaded to the server, or downloaded to the clients web browser....i know there was a discussion about this a looong while back and there was software used, but i can't remember what it was :(

ie, i want to insert:

<img src="/path/to/image.gif">

at the bottom of all html files....

Akash
08-20-2002, 03:10 AM
erm.....is this even in the right forum??

mods: please move it if it isn't (prolly belings in software:confused: )