<?php
if(!empty($_POST))
{
if(file_put_contents("config.php","<?php\ndefine('SITENAME','".$_POST['SITENAME']."');\ndefine('ADMIN','".$_POST['ADMIN']."');\n?>"))exit("成功写入");
die("写入失败");
}
?>
<!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=gb2312" />
<title>无标题文档</title>
</head><body>
<form id="form1" name="form1" method="post" action="">
  sitename:
  <input type="text" name="SITENAME" />
  admin:
  <input type="text" name="ADMIN" />
  <input type="submit" name="Submit" value="提交" />
</form>
</body>
</html>就是我编出来的,试过肯定可以,很简单的。