Hi!
I just want to ask if it is possible to generate a new html file each time user (i.e. admin) makes a new page available through website.
I usually work on a create.php file as the basic file to create new pages. The create.php file contains a form with textarea and input tags.
The form includes action attribute equal to preview.php so I can be able to preview before make the new page available to general public.
Create.php and preview.php located in the same folder which I called /root/members/admin/posts/. These are all I have already done.
And this is what I wan to do next. When I see that the new page is ok I want to publish it with a new file name (i.e. newname), new file extension (i.e. newname.html), and finally, place it under new folder (i.e. /root/members/posts/newname.html).
This is the code of the create.php file:
<form action="/root/members/admin/posts/preview.php" method="post">
<textarea name="title"></textarea>
<textarea name="body"></textarea>
<input type="submit" formtarget="_blank">
</form>
This is the code of preview.php file:
<form action="/root/members/posts/newname.html" method="post">
<?php echo $_POST["title"]; ?>
<?php echo $_POST["body"]; ?>
<input type="submit" name="publish" value="Publish" formtarget="_blank"/>
</form>
I'm not sure if I make it clear so if you need more info about it I may be able to provide. Also note or suggest any other ways that might be better that the one that I'm trying to implement.
Thanks,