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.
I ripped this code from the Freeola hit counter:
$content = "";
if (!$content) $content = "No content";
if(file_exists($content) == TRUE) {
$update = file($content);
$update = $formtext
} else {
$update = "No content";
}
$fp = fopen($content, "w");
fwrite($fp, $update); echo $update;
?>
Now, I think part of it doesn't work because of the fact that I'm trying to use text instead of integers. Am i right? Am I wrong? You tell me. Please.
> Np, just his code isn't written correctly:
>
>
>
> > //the filename of the file to be updated
> //this file should be on your webspace with permisions set to 777
> $filename="example.data";
>
> if (isset($message))
> {
> $fp=fopen($filename, "a"); //opens the file for appending
> fwrite($fp, $message."
"); //writes the posted
> message to the file
> }
> //includes the file which will be updated
> include($filename);
> ?>
> > method=post>
>
>
>
>
>
Hang on, did you just type out his code again? I can't see any difference. Come on people, give this to me on a plate!
//the filename of the file to be updated
//this file should be on your webspace with permisions set to 777
$filename="example.data";
if (isset($message))
{
$fp=fopen($filename, "a"); //opens the file for appending
fwrite($fp, $message."
"); //writes the posted message to the file
}
//includes the file which will be updated
include($filename);
?>
Parse error: parse error, unexpected T_STRING in /freeola/users/3/1/sr0199213/htdocs/phptest.php on line 8
Is it something to do with Freeola's permissions?
Parse error: parse error, unexpected T_STRING in /freeola/users/3/1/sr0199213/htdocs/phptest.php on line 8
Is it something to do with Freeola's permissions?
Parse error: parse error, unexpected T_STRING in /freeola/users/3/1/sr0199213/htdocs/phptest.php on line 8
Is it something to do with Freeola's permissions?
//the filename of the file to be updated
//this file should be on your webspace with permisions set to 777
$filename="example.data";
if (isset($message))
{
$fp=fopen($filename, "a") //opens the file for appending
fwrite($fp, $message."
") //writes the posted message to the file
}
//includes the file which will be updated
include($filename);
?>
> I've been trying to make a page with a form that points to a PHP file
> that updates a variable that is then displayed at the top of the form
> page - you know, like a bulletin board.
Tell me exactly what you want the script to do (e.g. what type of variable - numerical or string?) and I will give you the script for it.
if (!$content): $content = "No content"; endif;
if(file_exists($content) == TRUE) {
$update = file($content); // get the number of hits from the file...
$update = $formtext; // ...and overwrite it???
} else {
$update = "No content";
}
$fp = fopen($content, "w"); // ???
fwrite($fp, $update); // ???
echo $update;
?>
I think your script is screwed. I understand a code but it doesn't seem to do anything useful :-)