Hiya slazbag, there are a few ways you can do this, but this is how I'd do it. Just a word of warning, what you're trying to do is very insecure . ..
<?php
if(isset($_POST['html'])) { // Check if the form has been sent
if(trim($_POST['html']) != "") { // Check if there's anything in the textarea
// Open the file pointer, write to it, then close it.
$fp = fopen($_POST['FilePath'], "w+") or die("Opening file failed!");
fwrite($fp, $_POST['html']);
fclose($fp);
} else {
echo "Did you forget?"; // Swear violently at the user who is trying to break your server
}
}
// Display the form
echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<input type=\"text\" name=\"FilePath\"><br />";
echo "<textarea name=\"html\">html in here</textarea><br />";
echo "<input type=\"submit\" value=\"go\">";
?>