I did a code in PHP where input is saved to the file 'news'. Now I would like to change it that it will save every input to separate file in special folder(news) which name starts with date.
I wrote something like this but it isn't working (the file isn't being created)
<?php
include "0begin.php";
$title=$_POST["title"];
isset($title) or $title=$_GET["title"];
$msg=$_POST["msg"];
?>
<h1>News</h1>
<form method=post>
Title<br><input type=text input name="title" value=<?=$title?> ><br>
Message<br>
<textarea input name="msg" cols=40 rows=5> </textarea><br>
<input type="submit">
<br><br>
</form>
<?php
$msg = $_POST['msg'];
$dateposted = date("YmdHis");
$fp = fopen("$dateposted.txt", "w");
fwrite($fp,$title, $msg).' ';
fclose($fp);
?>
<?php
include "0end.php";