Skip to content

Instantly share code, notes, and snippets.

@pureexe
Created April 20, 2012 04:34
Show Gist options
  • Select an option

  • Save pureexe/2426027 to your computer and use it in GitHub Desktop.

Select an option

Save pureexe/2426027 to your computer and use it in GitHub Desktop.
จากที่ คุณ max ฝากทำ
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>debug</title>
</head>
<body>
<p>
<?php
if($_POST["link"]==1)
{
$data=file_get_contents($_POST["filename"]);
echo "<form id='form1' name='form1' method='post' action=''>
<p>แก้ไฟล์</p>
<p>
</p>
<input name='link' type='hidden' id='link' value='2' />
<input name='filename' type='hidden' id='filename' value='".$_POST["filename"]."' />
<input type='text' name='info' id='info' value='".$data."'/>
<p>
<input type='submit' name='submit' id='submit' value='Submit' />
</p>
</form>";
}
else if($_POST["link"]==2)
{
$u=fopen($_POST["filename"],'w');
fwrite($u,$_POST["info"]);
fclose($u);
echo "save complete";
}
else
{
echo "<form id='form1' name='form1' method='post' action=''>
<p>กรอกชื่อไฟล์</p>
<p>
<input type='text' name='filename' id='filename' />
</p>
<input name='link' type='hidden' id='link' value='1' />
<p>
<input type='submit' name='submit' id='submit' value='Submit' />
</p>
</form>";
}
?>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment