Here is the HEREDOC documentation, I'm not sure of what u r trying to achive, for example :
$crappychat_service will give you something like Resource #14, not usefull result to write in a file.
Try using this :
<?php
//Make logChatInput.php
$dataBase = "users";
$logChatInput = fopen($newDir."/logChatInput.php", "w");
date_default_timezone_set('America/Chicago');
$time = date('g:i A');
$chatInput = addslashes($_GET["chatInput"]);
$connectionStatus = NULL;
$crappychat_service = mysql_connect("localhost", "root", "123");
$connectionStatus = ($crappychat_service) ? 'Connected' : 'Failed to connect';
$dbSelectionStatus = NULL;
$dbSelectionStatus = (mysql_select_db("{$dataBase}", $crappychat_service)) ? 'DB selected' : 'DB not found';
$sql = "INSERT INTO messages (Message) VALUES('".$chatInput."')";
$queryStatus = NULL;
$queryStatus = (mysql_query($sql, $crappychat_service)) ? 'Query OK' : 'Query failed';
$logChatInput_contents = <<<EOD
chatInput value : $chatInput
MySql connection : $connectionStatus
Database selection : $dbSelectionStatus
SQL : $sql
Query status : $queryStatus
EOD;
var_dump($logChatInput_contents);
fwrite($logChatInput, $logChatInput_contents);
fclose($logChatInput);
Will output :
string '
chatInput value : dslfkd
MySql connection : Connected
Database selection : DB not found
SQL : INSERT INTO messages (Message) VALUES('dslfkd')
Query status : Query failed' (length=209)
I hope this sets u in the right direction