To Whom It May Concern
Using fopen(), fsockopen(), fputs(), fclose() how to update a sample text file which is already residing in the Apache server.
I'm working in an exchange server ( both Internet and Intranet ) and I have my apache installed, I want to test the files locally.
So, I have uploaded my php3 file and a sample text file.
<?php
$fp = fopen ("http://valinux-system/raj/sample.txt", "r+");
if ($fp)
{
print "The file exists";
$str = "there";
fwrite ($fp, $str);
echo "$str";
}
else
{
print "The file does not exist";
}
?>
The keyword 'there' is not getting updated on to the sample.txt file.
What could be wrong??? I would be glad if you illustrate me with examples.
Please help me out!!!
With Thanks & Regards,
Raj.