hendri2
asked on
inject php code into html file
i have alot of html file need to edit , only insert <?php include "header.php";?> in every html file, this file in my_html folder , is there any quick way to do that , than open every file just for doing that . administrator not allow using mod_layout .
thanks in advance
thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can also use sed/perl to do this, eh?
ASKER
can u gave me sed/perl code for that
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The way I usually do this type of replace is to ask my editor to search and replace through every file in my directory. I use DWMX2004, but as Roonaan mentioned, any multi-file editor will do.
Assuming I want header.php to be included as the first line after the <body> opening tag in every page:
I would search for:
'<body>'
... and replace with:
'<body>
<?php include "header.php"; ?>'
Don't need to give me any points, but this may not have been as obvious as it seems.