hi everyone...
code problem:
if i execute the code bellow i get: Cannot write to file... ok. if i change $stuff to "whatever" it writes to the file.... if i put the code in getContent() in a page works fine.... how can i get this class to do whatever it needs to and then get the output written to a file? and also is there a way to periodically hit this code to generate the "special.txt" within php. something like cron or another way....
all ideas and suggestions are welcomed....
thanks.....
ps: i also tried:....... fwrite($handle, $stuff=getContent() )...... but same result...
<?
function getContent() {
require("phpclass.php");
$sp = new Special();
$sp->parse();
$sp->destroy();
}
$filename = "special.txt";
$stuff = getContent();
if (!$handle = fopen($filename, 'w')) {
print "Cannot open file ($filename)";
exit;
}
if (!fwrite($handle, $stuff)) {
print "Cannot write to file ($filename)";
exit;
}
fclose($handle);
?>