Please help me out with this
Posted: Tue Oct 20, 2009 5:03 pm
Trust me, I realize I am about to get pwned by you guys for being a new poster on the board already asking for help but I really need it... I cant figure out why this wont work. It seems to be correct, am I missing something?
oh yeah... the point. Im trying to get this simple form to edit the content of these text files so that I can use them with another script.
thanks for your help guys this is really bugging me.
oh yeah... the point. Im trying to get this simple form to edit the content of these text files so that I can use them with another script.
Code: Select all
<?php
$name = "name.txt";
$file01 = fopen($name, "w+");
if($_POST['name']) fwrite($file01, $_POST['name']);
fclose($name);
$price = "price.txt";
$file02 = fopen($price, "w+");
if($_POST['price']) fwrite($file02, $_POST['price']);
fclose($price);
$desc = "desc.txt";
$file03 = fopen($desc, "w+");
if($_POST['desc']) fwrite($file03, $_POST['desc']);
fclose($desc);
$barcode = "barcode.txt";
$file04 = fopen($barcode, "w+");
if($_POST['barcode']) fwrite($file04, $_POST['barcode']);
fclose($barcode);
?>
<form action="<?=$PHP_SELF?>" method="post">
<p>Name:
<input type="text" name="name"/>
</p>
<p>Price:
<input type="text" name="price"/>
</p>
<p>Description:
<input type="text" name="desc"/>
</p>
<p>Barcode #:
<input type="text" name="barcode"/>
</p>
<p>
<input type="submit"/>
</p>
</form>