hi all
i have a problem with file content copying. i have index.php and there are codes in it. i would like to create indexa.php and append index.php file contents to newly created indexa.php file
thanks beforehands
here is my file
<?php
// This function shows your form
function form(){
echo "<form action='?act=create' method='post'>"
."Faylin adi olacaq: <input type='text' name='filename' size='30'><br>"
."<textarea cols='50' rows='10' name='content'></textarea><br>"
."<input type='submit' value='Create'>"
."</form>";
}
if(isset($act)){
return create();
}
// This function will create your file
function create(){
// Gather info into variables from our form
$sade="index.php";
$filename = $_REQUEST['filename'];
$filename=$filename.'.php';
$content1=fopen($sade,'r')
$content = fread[$content1,"a"];
$act=$_REQUEST['act'];
// Now let's create our file
$open = fopen($filename, "a"); // Now this file is ready for overwriting
fwrite($open, $content); // This will write your text what was in textarea into your file
fclose($open); // Closes your file
}
form();
?>