<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="phptext.php">
<textarea name="txtdata" cols="100" rows="10" id="txtdata">
<?php
$filename = "mydata.txt";
$content="";
$data=$_POST['txtdata'];
if(file_exists($filename))
{
$handle=fopen($filename,'r+');
$content=fread($handle,10000);
print($content);
}
else
{
$handle=fopen($filename,'w+');
}
if(isset($_POST['refresh']))
{
fwrite($handle,$data);
print($content);
}
?>
</textarea>
<input name="refresh" type="submit" id="refresh" value="refresh">
</form>
</body>
</html>
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="phptext.php">
<textarea name="txtdata" cols="100" rows="10" id="txtdata">
<?php
$filename = "mydata.txt";
$content="";
$data=$_POST['txtdata'];
if(file_exists($filename))
{
$handle=fopen($filename,'r+');
$content=fread($handle,10000);
print($content);
}
else
{
$handle=fopen($filename,'w+');
}
if(isset($_POST['refresh']))
{
fwrite($handle,$data);
print($content);
}
?>
</textarea>
<input name="refresh" type="submit" id="refresh" value="refresh">
</form>
</body>
</html>
Comments
Post a Comment