Hi guys.
I recently started to learn php. But sometimes i have problems
I have one today, and i hope someone can help me.
Im trying to create a php site. Where i can edit 3 text files (on my server) from that php site.
Its works fine for editing a single txt file.
But when i include the others, it makes some errors. Like: changing all 3 .txt files.
Heres my (edit text files page):
<?php include_once "eddauthor.php"; // Author include_once "eddemails.php"; // Emails include_once "eddcomment.php"; // Comment ?>And heres ONE of my edit txt file scripts: (1 of 3)
Author:<?
if($_POST[‘Submit’]){
$open = fopen(“author.txt”,“w+”);
$text = $_POST[‘update’];
fwrite($open, $text);
fclose($open);
echo “File updated.
”;
echo “File:
”;
$file = file(“author.txt”);
foreach($file as $text) {
echo $text."
";
}
}else{
$file = file(“author.txt”);
echo “<form action=”".$PHP_SELF."" method=“post”>";
echo “<textarea Name=“update” cols=“10” rows=“1”>”;
foreach($file as $text) {
echo $text;
}
echo “”;
echo "<input name=“Submit” type=“submit” value=“Update” />\n
Can anyone help me? i just want to be able to edit all boxes/ txt on the same site.
Best regards,
Mike / xan