This is an idea i had to make 3 page instead of 20. There are going to be 12 of these forms on this page. I'm going to use a toggle to show the files the user can edit. The submit will only submit the form it is in correct? And will the input type="hidden" name="page" value="alumni" pass over and open the text file associated with it in the submitpage.php.
This is the code for the first page where there will be a list of files:
PHP Code:
<form method="post" action="submitpage.php" style="border:#000000 2px solid; width:750px;">
<input type="hidden" name="page" value="alumni" />
<textarea name="data" rows="20" cols="90">
<?php
$myFile = "alumni.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, 20000000);
fclose($fh);
echo $theData;
?>
</textarea>
<input type="submit" value="Submit Changes" style="text-align:center; font-family:Geneva, Arial, Helvetica, sans-serif; font-size:14px;" />
</form>
This is the submitpage.php
PHP Code:
<?php
$notes = $_POST['data'];
$page = $_POST['page'];
$File = ($page . ".txt");
$Handle = fopen($File, 'w');
$Data = $notes;
fwrite($Handle, $Data);
fclose($Handle);
echo "The" . $page . "page has been updated.";
?>
Thanks for any suggestions or answers you can offer.
Bookmarks