Hi all,
Am a beginner in PHP. Trying to use fopen and write some content on a php file which is not exisiting in the specified path.
$date = date ("m.j.y");
$file_name="/headlines/hindu/$date.php";
$open_file = fopen ($file_name, "r+");
fwrite ($open_file, $content);
This is the code i tried with. Iexpected a php file written with the current date as file name in the specified path. I am trying this in my local windows system. Am getting warning error msg.
Warning: fopen(/headlines/hindu/04.2.04.php): failed to open stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\nags\test.php on line 18
Warning: fwrite(): supplied argument is not a valid stream resource in C:\Program Files\Apache Group\Apache2\htdocs\nags\test.php on line 19
Confused with whats wrong there. Someone help please!