GetDotted Domains

Viewing Thread:
"php news"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sun 26/05/02 at 14:00
Regular
Posts: 787
I've got a php news script on my site, it works well, except for the fact that the new news is entered at the bottom of the page and the old news stays at the top.
So, unless I edit the news data to turn the tables around everytime I enter some news it will stay the same.
Is there a script I can enter to flip the tables around or so that next time I enter some news in it enters it into the top instead of the bottom? thanks.

news script: http://membres.lycos.fr/enterthefog/update/news.php
Sun 26/05/02 at 17:38
Regular
"IT'S ALIVE!!"
Posts: 4,741
if ( ! file_exists("news.txt") ) {
touch("news.txt");
} else {

I think thats what he means.
The original script posts the new news at the bottom instead of at the top, which isn't good.

http://membres.lycos.fr/enterthefog/update/news.php
Sun 26/05/02 at 17:26
Regular
"It goes so quickly"
Posts: 4,083
Nimco wrote:
> ooops! didnt put in the 'else' statement


Where???
Sun 26/05/02 at 17:25
Regular
"It goes so quickly"
Posts: 4,083
So how does it work now??? The original one???
Sun 26/05/02 at 17:11
Regular
"IT'S ALIVE!!"
Posts: 4,741
:( still not letting me do it. Thanks for all your work though. :D nice people.
Sun 26/05/02 at 16:58
Posts: 0
ooops! didnt put in the 'else' statement
Sun 26/05/02 at 16:53
Regular
"It goes so quickly"
Posts: 4,083
Sorry, didn't see the link


--------------------

print "

Submit News

";
if ( isset($actionflag) && $actionflag == "join")
{
if ( ! file_exists("news.txt") ) {
touch("news.txt");
} else {
$fp = fopen( "news.txt", 'r' );
$Existing_File = fread($fp, filesize('news.txt'));
fclose($fp);
}
$fp = fopen( "news.txt", 'w' );
fwrite ( $fp, "
");
fwrite ( $fp, "$form[subject]
" );
fwrite ( $fp, "Posted by $form[author]
" );
fwrite ( $fp, "$form[text]" );
fwrite ( $fp, "
\n");
fputs ( $fp, $Existing_File);
print "News Sent!";
fclose($fp);
}
if ( isset($clearflag) && $clearflag == "clear")
{
unlink("News.txt");
touch("News.txt");
print "Database reset!";
}
?>



-----------


try that
Sun 26/05/02 at 16:48
Regular
"It goes so quickly"
Posts: 4,083
Send the .zip of all the file to [email protected] if you like :o)
Sun 26/05/02 at 16:43
Regular
"IT'S ALIVE!!"
Posts: 4,741
neither of them did it, Nimco's edit didn't post the news, Turbonutter's kept the script the same, tis weird, it's probably my cache playing up.
Sun 26/05/02 at 16:33
Regular
"It goes so quickly"
Posts: 4,083
What Nimco wrote should do it.

Though I think it would be better to right just the data values, without the HTML Tags in, as if you wanted to change the layout of your site, you'd have to go though the while file.
Sun 26/05/02 at 15:02
Regular
"Eff, you see, kay?"
Posts: 14,156
Ah, so you're opening and appending. Good plan.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Thanks!
Thank you for dealing with this so promptly it's nice having a service provider that offers a good service, rare to find nowadays.
Many thanks!!
Registered my website with Freeola Sites on Tuesday. Now have full and comprehensive Google coverage for my site. Great stuff!!
John Shepherd

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.