Hello,
I'm reading a file on my server and then I'm writing that file out to a different directory. In the original file there is a tag <-- $username -->. In the new file that is written I'd like all occurrences of <-- $username --> replaced with an actual username. Here is the script I'm using:
Any ideas would be appreciated,
Tim Mousel
I'm reading a file on my server and then I'm writing that file out to a different directory. In the original file there is a tag <-- $username -->. In the new file that is written I'd like all occurrences of <-- $username --> replaced with an actual username. Here is the script I'm using:
PHP Code:
$file_loc = "/home/public_html/index.html";
$whattoread = fopen($file_loc, "r");
$file_contents = fread($whattoread, filesize($file_loc));
fclose($whattoread);
//new file to make. This is the file I would like all occurrences of <-- $username --> to be replaced with the actual username.
$newfile = fopen"/home/public_html/affiliates/username.html", "w");
fwrite($newfile, "$file_contents");
fclose($newfile);
Tim Mousel
Comment