Link to home
Create AccountLog in
Avatar of Simon336697
Simon336697Flag for Australia

asked on

Creating a copy of a php page

Hi guys hope u r all well.

What Im trying to achieve as the final result is the following...

====================================================== test.php

Please select what menu level you wish to create..
< select.... >                       <------------------- user selects from the following 4 files (templates)
-- menu1_x.php
-- menu2_x_x.php
-- menu3_x_x_x.php
-- menu4_x_x_x_x.php  

<Create new file>              <-------------------------- upon selecting above, they click on create new file

Enter new filename: ____________________   <-------- they enter a new filename here

<submit>        <-------------------------------------------- they click submit to have the new file created

=========================================================

# The 4 "template" files upon which a new file is created are as follows...

<docroot>/simeswiki/templates
menu1_x.php
menu2_x_x.php
menu3_x_x_x.php
menu4_x_x_x_x.php  

So,
after the user selects one of these, this selection is used as the basis upon which to copy

eg. selection is menu2_x_x.php

Now, when the user clicks on create new file..... menu2_x_x.php
is the source file in the following.....

cp menu2_x_x.php <target_new_file>.php

New files to be saved in <docroot>/simeswiki

Any help on this would be greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of psimation
psimation
Flag of South Africa image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Simon336697

ASKER

HI psimation,
Mate thanks for your help.

So are you saying the below................

One of the "template" files I have is menu1_x.php

======================================================== menu1_x.php
<body>
<div id="body_container">
        <?php include ("includes/body_container.php"); ?>
</div>
</body>
</html>
========================================================
are you saying to store the
<?php include ("includes/body_container.php"); ?>
in a database?
Thanks psimation..