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.
All I want is a basic script that allows information that is submitted through a text box to appear on the site.
When I say basic I mean basic as in monkey_man's old chat scripts he used to have on his site.
Anybody know of any basic tutorials that could explain how to do this?
I've got a feint idea of what to do, just not how to do it!
Thanks.
$File = "rightframe.txt";
if (file_exists($File)) {
$fp = fopen($File, "r");
flock($fp, 1); # Lock the File.
while (! feof($fp)) {
$Line = fgets($fp, 1024);
print "$Line
\n";
}
flock($fp, 3); # Release the File Lock.
fclose($fp);
} else {
print "
Can't include the text, file doesn't exist or
can't be opened.
}
?>
I'll find something.
P.S
You know too much!
:c)
Are you writing these codes yourself or do you have a little archive?
$File = "rightframe.txt";
if (file_exists($File)) {
$fp = fopen($File, "r");
flock($fp, 1); # Lock the File.
$Content = file($fp);
flock($fp, 3); # Release the File Lock.
fclose($fp);
foreach ($Content as $Temp) {
$Temp = stripslashes($Temp);
print $Temp."
\n";
}
} else {
print "
Can't include the text, file doesn't exist or
can't be opened.
}
?>
if (file_exists($File)) {
$fp = fopen($File, "r");
flock($fp, 1); # Lock the File.
$Content = fread($fp, filesize($File));
$Content = stripslashes($Content);
flock($fp, 3); # Release the File Lock.
fclose($fp);
str_replace("\n", "
", $Content);
print "$Content\n";
} else {
print "
Can't include the text, file doesn't exist or can't be opened.
\n";}
?>
Like that?
If so it still displays the text in one line...
http://members.lycos.co.uk/phi11ip/mainpage.php is the page I'm working with, you can see the text in a line in the middle of the page.
http://members.lycos.co.uk/phi11ip/mainframe.txt is the file it comes from.
For HTML:
str_replace("\n", "
", $Content);
For xHTML:
str_replace("\n", "
", $Content);
$File = "main.txt";
if (file_exists($File)) {
$fp = fopen($File, "r");
flock($fp, 1); # Lock the File.
$Content = fread($fp, filesize($File));
$Content = stripslashes($Content);
flock($fp, 3); # Release the File Lock.
fclose($fp);
print "$Content\n";
} else {
print "
Can't include the text, file doesn't exist or can't be opened.
\n";}
?>
How do I get it to display the text on seperate lines when I include it on the page?
At the moment it just comes as a big long line of text even though it's stored as seperate lines in the txt file.
Thanks, again in advance!
It does work.