stc7outlaw
Programmer
I am a new programmer and I have gathered some code together to form this one. I want this code to write to 4 separate text files without the other ones changing. IF you try this code you will see what i mean. I have 4 separate update files update1.txt update2.txt update3.txt update4.txt. I want to be able to modify each of them when i want to but I want to keep it all on the same page. This page is called line_updates.php. Here is the code:
<HTML>
<HEAD>
<TITLE></TITLE>
<META name="description" content="">
<META name="keywords" content="">
<META name="generator" content="CuteHTML">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
This is the current Text for Today's FHS News:<br>
<?php
$fp = fopen("update1.txt", "w" // Open a file pointer
fputs($fp, $update1); // Write the value of $test
// to file.txt
echo ("Line 1: $update1<br>"
$fq = fopen("update2.txt", "w" // Open a file pointer
fputs($fq, $update2); // Write the value of $test
// to file.txt
echo ("Line 2:$update2<br>"
$fr = fopen("update3.txt", "w" // Open a file pointer
fputs($fr, $update3); // Write the value of $test
// to file.txt
echo ("Line 3:$update3<br>"
$fs = fopen("update4.txt", "w" // Open a file pointer
fputs($fs, $update4); // Write the value of $test
// to file.txt
echo ("Line 4:$update4<br>"
fclose($fp);
fclose($fq);
fclose($fr);
fclose($fs);
?>
<form method=post action=<? echo $PHP_SELF; ?> >
<input type="text" name="update1">
<input type=submit name=submit value="write file">
</form>
<form method=post action=<? echo $PHP_SELF; ?> >
<input type="text" name="update2">
<input type=submit name=submit value="write file">
</form>
<form method=post action=<? echo $PHP_SELF; ?> >
<input type="text" name="update3">
<input type=submit name=submit value="write file">
</form>
<form method=post action=<? echo $PHP_SELF; ?> >
<input type="text" name="update4">
<input type=submit name=submit value="write file">
</form>
</BODY>
</HTML>
Please modify the code so I can use it and update the files separately to the 4 separate files. THANK YOU.
<HTML>
<HEAD>
<TITLE></TITLE>
<META name="description" content="">
<META name="keywords" content="">
<META name="generator" content="CuteHTML">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
This is the current Text for Today's FHS News:<br>
<?php
$fp = fopen("update1.txt", "w" // Open a file pointer
fputs($fp, $update1); // Write the value of $test
// to file.txt
echo ("Line 1: $update1<br>"
$fq = fopen("update2.txt", "w" // Open a file pointer
fputs($fq, $update2); // Write the value of $test
// to file.txt
echo ("Line 2:$update2<br>"
$fr = fopen("update3.txt", "w" // Open a file pointer
fputs($fr, $update3); // Write the value of $test
// to file.txt
echo ("Line 3:$update3<br>"
$fs = fopen("update4.txt", "w" // Open a file pointer
fputs($fs, $update4); // Write the value of $test
// to file.txt
echo ("Line 4:$update4<br>"
fclose($fp);
fclose($fq);
fclose($fr);
fclose($fs);
?>
<form method=post action=<? echo $PHP_SELF; ?> >
<input type="text" name="update1">
<input type=submit name=submit value="write file">
</form>
<form method=post action=<? echo $PHP_SELF; ?> >
<input type="text" name="update2">
<input type=submit name=submit value="write file">
</form>
<form method=post action=<? echo $PHP_SELF; ?> >
<input type="text" name="update3">
<input type=submit name=submit value="write file">
</form>
<form method=post action=<? echo $PHP_SELF; ?> >
<input type="text" name="update4">
<input type=submit name=submit value="write file">
</form>
</BODY>
</HTML>
Please modify the code so I can use it and update the files separately to the 4 separate files. THANK YOU.