View Single Post
  #1  
Old 12-07-2005, 05:56 AM
johny johny is offline
OSP Starters
 
Join Date: Dec 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
johny is on a distinguished road
Default Errors with php script

Hi I am always getting these errors:::

Warning: file_get_contents(test): failed to open stream: No such file or directory in /home/prawgzn/public_html/m/remove.php on line 5

Warning: fopen(test): failed to open stream: Permission denied in /home/prawgzn/public_html/m/remove.php on line 9

Warning: fputs(): supplied argument is not a valid stream resource in /home/prawgzn/public_html/m/remove.php on line 10

Warning: fclose(): supplied argument is not a valid stream resource in /home/prawgzn/public_html/m/remove.php on line 11 with the code..

PHP Code:
<?php
$filename = 'test.txt';
$somecontent = $_GET['data'] . "\n";

$file_data = file_get_contents($filename);

$file_data = str_replace($somecontent, "", $file_data);

$file = fopen($filename, "w");
fputs($file, $file_data);
fclose($file); < -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - Errors with php script
View Single Post
  #1  
Old 12-07-2005, 05:56 AM
johny johny is offline
OSP Starters
 
Join Date: Dec 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
johny is on a distinguished road
Default Errors with php script

Hi I am always getting these errors:::

Warning: file_get_contents(test): failed to open stream: No such file or directory in /home/prawgzn/public_html/m/remove.php on line 5

Warning: fopen(test): failed to open stream: Permission denied in /home/prawgzn/public_html/m/remove.php on line 9

Warning: fputs(): supplied argument is not a valid stream resource in /home/prawgzn/public_html/m/remove.php on line 10

Warning: fclose(): supplied argument is not a valid stream resource in /home/prawgzn/public_html/m/remove.php on line 11 with the code..

PHP Code:
<?php
$filename = 'test.txt';
$somecontent = $_GET['data'] . "\n";

$file_data = file_get_contents($filename);

$file_data = str_replace($somecontent, "", $file_data);

$file = fopen($filename, "w");
fputs($file, $file_data);
fclose($file); < -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote