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.
$Data = htmlentities($Data);
... before writing to the file. This replaces any HTML with character codes, so should someone enter any HTML within the Input, the HTML won't be active when it is displayed on the page.
Thanks!
Starting to look like I want it now.
'a' adds to the bottom, whereas 'w' overwrites it all.
How would I go by it completely wiping the previous data in the file whatever. and adding the new stuff.
So each time something is added to the box the old data is stored over.
Oh, and it took my ages to work out that 'data' won't copy through as the variable $Data!
Stupid capitals!
if ($Data) {
$File = "whatever.inc";
if (file_exists($File)) {
$fp = fopen($File, "r");
flock($fp, 1); # Lock the File.
$Content = fread($fp, filesize($File));
flock($fp, 3); # Release the File Lock.
fclose($fp);
$fp = fopen($File, 'w');
flock($fp, 2); # Set File Lock.
fputs($fp, $Data);
fputs($fp, "\n";);
fputs($fp, $Content);
flock($fp, 3); # Release File Lock.
fclose($fp);
print "
Thanks for adding your input
\n";} else {
print "
ERROR: Could not locate the required file.
\n";}
} else {
print "
No Data entered
\n";}
?>
Create a file called 'whatever.inc' for where you want the data to be stored. When you want this to be displayed, add this onto the page:
For the Form to Submit the data the the PHP Script, have it use this code:
if ($Data) {
$File = "whatever.inc";
if (file_exists($File)) {
$fp = fopen($File, "a");
flock($fp, 2); # Lock the File.
fputs($fp, $Data);
flock($fp, 3); # Release the File Lock.
fclose($fp);
print "
Thanks for adding your input
\n";} else{
print "
ERROR: Could not locate the required file.
\n";}
} else {
print "
No Data entered
\n";}
?>
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.