- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
So I have this html template, and I would like PHP to look at this template, and make a new html page, that is a copy of this, and only change the name of the file.
Basically:
template.html -> PHP -> template-copy.html
I don’t understand karlpcrowley’s code use. That’s just talking about filenames or so. I want to create a new file entirely, but that has the same content.
And I can give it read and write permissions. That’s OK.
I’m testing the import/outport, where I may be able to edit variables within the imported file before exporting it.
Can I do this?
I create an HTML template with PHP variables for in certain places.
I then run a PHP script, that copies the template, giving the variables a different value each time (might this work with input/output?)
A new page is created, that has the same structure as the template, with only the variables changing.
Thanks for responding.
Could you explain what that does please? (and what is variable scanning?)
I’m rather new to PHP, so I don’t get what passing the variables to the functions makes them do.
$file = ‘template.html’;
$newfile = ‘template-copy.html’;
if (!copy($file, $newfile)) {
echo “failed to copy $file…n”;
}
With that, could I have a dialogue box that the customer could put in the name that they wanted? Say I have template.html and I add content to make it a blog. Then a window (or something) comes up and asks what I want to save it as. Then the modified template would become blog.html. Also, would there be any trouble viewing the new pages? Sorry if that made little sense. It’s really late and I’m on my iPad.