Variable html textfield on displays when updated from flash form?

hey all,

i have a flash form which i update content on a html page through php

here is my php code:

<?php
$filename = $_POST["filename"];
$theText = $_POST["theText"];

$theText = ($theText);

$data = fopen($filename, "w");

fwrite($data,$theText);

fclose($data);

echo "File created or updated";
?>

for some reason when i look at the html page after the content has been added the tables and css etc are all gone nothing displays in the browser other than the text field and a white background?? why??