news/update
Posted: Thu Mar 25, 2004 1:49 am
Whats up ppl !
Got a small prob. So i call for the best of yall at this forum.
Basically this what i want to do:
- I want create a system/procedure for a user who updates information alot on their website.
- You got two pages:
- main.php
- form.php
THe main.php file is the main file that any user see's. It also includes teh "include statement". Which is not a problem.
The form.php is the page. That the admin of the site can access. WHere whatever the admin inserts into the text box. That information should be collected, and written into the txt file.
So when you view main.php The information should be updated.
Below is the code that i generated. Now ppl keep in mind, that i just picked up php. So go easy. Also i want to use php on this web project i got my self into
<html>
<head>
<title>form</title>
</head>
<body>
<form action="main.php" method="get">
<textarea name="news" wrap="VIRTUAL" cols="40" rows="10"></textarea>
// open file if not there create file
<?php
$toFile = fopen("news.txt", "w");
// write to file
fputs($toFile, "$news");
// close file
fclose($toFile);
?>
<input type="submit" name="submit">
</form>
</body>
</html>
any help is appreciated it.....thx !
Got a small prob. So i call for the best of yall at this forum.
Basically this what i want to do:
- I want create a system/procedure for a user who updates information alot on their website.
- You got two pages:
- main.php
- form.php
THe main.php file is the main file that any user see's. It also includes teh "include statement". Which is not a problem.
The form.php is the page. That the admin of the site can access. WHere whatever the admin inserts into the text box. That information should be collected, and written into the txt file.
So when you view main.php The information should be updated.
Below is the code that i generated. Now ppl keep in mind, that i just picked up php. So go easy. Also i want to use php on this web project i got my self into
<html>
<head>
<title>form</title>
</head>
<body>
<form action="main.php" method="get">
<textarea name="news" wrap="VIRTUAL" cols="40" rows="10"></textarea>
// open file if not there create file
<?php
$toFile = fopen("news.txt", "w");
// write to file
fputs($toFile, "$news");
// close file
fclose($toFile);
?>
<input type="submit" name="submit">
</form>
</body>
</html>
any help is appreciated it.....thx !