I have set permissions on a file. I'm encountering a very unusual error. When I do fwrite(), It's stopping the write short of writing the whole string. Here is my code:
$virtHostFile=($_GET[editFile]?$_GET[editFile]:'/etc/httpd/conf/httpd.virtualhost');
if($_POST){
echo 'writing file<br>';
$fp=fopen($virtHostFile, 'w');
$x=stripslashes($_POST[virtualhost]);
$y=strlen($x);
fwrite($fp,$x,$y);
}
What's wierd here is that the file is being written to, but only part of the file. Makes no sense. Yes, I have set permissions correctly.
Sam