I worked it out, not using that idea..
did it using a web based interface on the php server, and referenced the news file using <script src="">
works pretty well for a basic news updating script.
eg:
http://www.mysite.com/Post.php?post=heyCODE
<?php
$news = $_REQUEST['post'];
if ($news != "")
{
$newsfile = '/full_path_to/news.txt';
$countFile = '/full_path_to/count.txt';
$newsmodule = '/full_path_to/news.bas';
//get count
$cc = file($countFile);
$c = $cc[0];
//add new post
$today=date("F j, Y, g:i a");
$addnews = "MakeNews($c) = \"$today|$news\"";
$fp = fopen($newsfile , "a");
fwrite($fp, $addnews);
fwrite($fp, "\n");
fclose($fp);
//rewrite news.bas
//clear file
$fn = fopen($newsmodule, "w");
fwrite($fn, "");
fclose($fn);
//re-write array declare/dimension
$fn = fopen($newsmodule, "w");
$basheader = "Dim Makenews($c) \n";
fwrite($fn, $basheader);
fclose($fn);
//add news.txt
$fn = fopen($newsmodule, "a");
$fp = fopen($newsfile, "r");
$text = fread($fp,filesize($newsfile));
fwrite($fn, $text);
fclose($fn);
fclose($fp);
//amend count
$c++;
$fr = fopen($countFile, "w");
fwrite($fr, $c);
fclose($fr);
echo "News Updated";
}
?>
This post has been edited by tel0r: 11 May, 2005 - 07:57 PM