I greatly appreciate all this help.
I'm such a novice I don't know anything about error reporting. I don't see it in the code I'm using above, which I copied, didn't write. Would appreciate any code addition to do this.
On the second point, I've set up a sample test htm file (which I uploaded to the server and tried with my script, to no avail). When I run the script in the same directory as the htm files I'm trying to change, it reports "Done - processed 5 files" where the fifth one is the new test htm file I uploaded.
I've attached that test htm file. I hope this helps.
Here once again, is the complete script I'm attempting to use:
<?php
// this script will search all the files of a specific type in a specific directory and do a mass change
//
// enter the string you want to change - it cannot contain the # char or the script will fail
$searchString = "http://test.one.com/";
// enter the new value for the string
$newValue = "http://test.two.com/";
// enter the path to the search directory, and the file type to search
$path = "*.htm";
//
// do not change anything below this line
$searchString = "#" . $searchString . "#";
$globarray = glob($path);
if ($globarray) foreach ($globarray as $filename) {
$source = file_get_contents($filename);
$source = preg_replace($searchString,$newValue,$source);
file_put_contents($filename,$source);
$count++;
}
echo "Done - processed $count files";
?>