Hmm, what's going wrong here?
CODE
Comment.php
<?php
$Read = "";
$Filename = "Data/Objects.txt";
$File = "";
function CheckObject()
{
global $Read, $File, $Filename;
$File = fopen( $Filename, "r" );
$Read = fread( $File, filesize( $Filename ) );
if( strpos( $Read, $_GET['object'] ) == FALSE )
{
fclose( $File );
return FALSE;
}
else
{
fclose( $File );
return TRUE;
}
}
function ReadComments()
{
global $Read, $File, $Filename;
$Filename = "Data/" . $_GET['object'] . "Comments.txt";
$File = fopen( $Filename, "r" );
$Read = fread( $File, filesize( $Filename ) );
fclose( $File );
}
if( CheckObject() )
{
ReadComments();
echo "<pre style=\"font: 10pt courier new\">" . $Read . "</pre><br />";
}
else
{
echo "Death from above";
die();
}
?>
CODE
Data/Objects.txt
Welcome
cChess
Console
CToken
UI
With ?object=Welcome. cChess, Console, CToken, and UI all work, and Welcome will work if I move it, and that causes cChess to stop working. So, the top line doesn't work?
Well, I just put a blank line above Welcome, but still, why wouldn't it work without that? Oh, and how do I make sure aren't doing ?object=Wel or ?object=come and stuff. It still lets them do that.