GetDotted Domains

Viewing Thread:
"Rob .... HELP (PHP)"

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.

Tue 05/03/02 at 23:45
Regular
Posts: 787
Hey Rob, do you know if and how it's possible to load the content of a .dat file into a PHP Variable???

The thing that Monkey_Man asked for, got me coding, and trying to make a simple ... v.simpl I should say, lol ... chat site.

Just all the msg's are coming up in the wrong order ... so if you (or anyone else here) know how to put the content of a .dat file into a PHP Variable, lets say $Chat_Text, I'd be greatful :o)
Mon 18/03/02 at 19:27
Regular
"Eff, you see, kay?"
Posts: 14,156
Erm, I'm not sure. Check the manual.
Mon 18/03/02 at 17:27
Regular
"It goes so quickly"
Posts: 4,083
Is there a function to count how many lines there are in a .dat file before doing anything with it (adding to it, updateing it, etc.)??
Thu 14/03/02 at 16:11
Regular
"It goes so quickly"
Posts: 4,083
Don't suppose some of you could goto http://www.haignet.co.uk/Chat/ and try it out, to see if the basics work.

You should be able to use the , and tags, but nothing else.

You should also be unable to post blank messages.

Would be greatful if you could see if it does that ok, and that the msg's come up ok for you.

Seem sot work ok for me, but I may have missed something

Thanks guys.
Thu 14/03/02 at 08:02
Regular
"Eff, you see, kay?"
Posts: 14,156
Ah, but $foo = `cat bar` is slower than fopen(), and unreliable if the script was moved to a WinNT system :)
Wed 13/03/02 at 23:43
Posts: 0
Oh c'mon.. be a perl stylee l33t hacker:

$foo = `bar`;
Fri 08/03/02 at 13:21
Regular
"Eff, you see, kay?"
Posts: 14,156
Throw a stripslashes() in there, it gets rid of those annoying escape characters.
Fri 08/03/02 at 12:11
Regular
"It goes so quickly"
Posts: 4,083
ok, you know how on this forum when you type in whatever, that it comes up ans text and not used as HTML.... how do you do that??

I tried that htmlentities(); thing but the speach-marks came up as "\" \and \""

what have I done wrong?
Fri 08/03/02 at 00:33
Regular
"It goes so quickly"
Posts: 4,083
WOW, it works :o)

Cheers for the help :o)
Fri 08/03/02 at 00:09
Regular
"It goes so quickly"
Posts: 4,083
So, do you think this sort of thing would do the trick:

$Chat_File = "Chat_Text.dat";

$Text = trim($Text);

if (! empty($Text)) {
$fp = fopen($Chat_File, 'w');
$datfile = fread($fp, filesize($Chat_File));
fclose($fp);

$fp = fopen($Chat_File, 'w');
$Time = date("g:ia");
fputs($fp, "\n$Username: $Text ($Time)
");
fputs($fp, $datfile);
fclose($fp);
}


or have I got that wrong??
Thu 07/03/02 at 23:51
Regular
"Eff, you see, kay?"
Posts: 14,156
That's exactly what I was going to suggest. There's no other way.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Excellent support service!
I have always found the support staff to provide an excellent service on every occasion I've called.
Ben
Second to none...
So far the services you provide are second to none. Keep up the good work.
Andy

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.