<?php
$myFile = "Wishes.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$mystring= $_POST["name"];
fwrite($fh, $mystring."\n\r");
fclose($fh);
?>
<!DOCTYPE html>
<html>
<head>
<title>Wish well</title>
<script language="javascript">
function sendtoajax(form)
{
var xmlhttp;
var content;
content=form.wish.value;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
alert('done')
}
}
xmlhttp.open("POST","ajax.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("form.text.value");
}
</script>
</head>
<body style="background-color:red;">
<form name="Text">
Text<input type="text" name="text"/>
<input type="button" class="button" value="Throw In" onclick="sendtoajax(this.form)"/>
<input type="reset" value="Cancel"/>
</form>
</body>
</html>
<?php
$myFile = "Wishes.txt";
$fh = fopen($myF