Jump to content

Why hasn't file_put_contents created a txt file in my working directory?


the5thace

Recommended Posts

I'm just trying to load some of the echoed results in to a txt file that I can use myself. I assumed that there should be a txt file in my server directory but no file has been created. What am I doing wrong? 

while ($blekr<=$blekko_count)
    {
        echo '<a href='.$Blekko[$blekr]['url'].'><h4>'.$Blekko[$blekr]['url_title'].'</h4></a>';
        echo '<p>'.$Blekko[$blekr]['snippet'].'<p>';
        echo '<b>'.$Blekko[$blekr]['engine'].'</b>';
        $file = 'Blekko.txt';
        file_put_contents($file, $Blekko[$blekr]['url'], FILE_APPEND);
        echo '<hr>';
        $blekr++;
    }

The echo statements run fine but no file anywhere to be found. There isn't anything said in the manual either ...

Ah, thanks what do I need to do in case of 

Warning: file_put_contents(Blekko.txt) [function.file-put-contents]: failed to open stream: Permission denied in /home/msc2012/12254822/public_html/safe_dir/Almost_Gs.php on line 369

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.