Link to home
Start Free TrialLog in
Avatar of hendri2
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
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cracky
cracky

Sorry to drop in, but I thought this would help elaborate:

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.
You can also use sed/perl to do this, eh?
Avatar of hendri2

ASKER

can u gave me sed/perl code for that
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial