Jump to content

Writting data to file


seularts

Recommended Posts

I used exactly the following code for a test:

 

<form name="form1" method="post" action="">
  <input name="key" type="text" id="key">
  <input type="submit" name="Submit" value="Submit">
</form>
<?php
if(isset($_POST['key'])){
$keyword=$_POST["key"];
$key=$keyword.', ';
$data = fopen('keywords.txt', "a");
fwrite($data,$key);
fclose($data);
}
?>

 

I entered "guilty" and submitted, "gear" and submitted and "guiltygear" and submitted and the output in "keywords.txt" is exactly: guilty, gear, guiltygear,

 

Cant seem to find a problem here!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.