Jump to content

How do I save a file up one directory?


ninevolt1

Recommended Posts

Thanks for the reply. Here is the add article code:

 

 

function add_article($filename, $news)

{

 

if(file_exists($filename)){

$fh = fopen($filename, "r");

$old_news = fread($fh, filesize($filename));

fclose($fh);

}

 

/* TODO: Multipage articles

preg_match_all("<!--ARTICLE PAGE=(\d*)-->", $old_news, $matches;

 

if( count($matches[0]) >= $max_summary){

$oldfilename = $filename.($matches[0][0]+1);

}

*/

 

$fh = fopen($filename, "w");

$news = stripslashes($news);

fwrite($fh, "$news $old_news");

fclose($fh);

}

 

 

 

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.