温馨提示:这篇文章已超过524天没有更新,请注意相关的内容是否还可用!
HTML提交表单代码:
<form name="form2" method="get" action="index.PHP" id="form2" onSubmit="return confirm('确认要操作?');">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr class="header">
<td height="25" colspan="2">配置修改
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><div align="right">姓名:</div></td>
<td height="25"><input name="name" type="text" id="name" value="<?=$fr[name]?>" size="80"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><div align="right">住址:</div></td>
<td height="25"><input name="cid" type="text" id="cid" value="<?=$fr2[cid]?>" size="80"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"> </td>
<td height="25"><input type="submit" name="Submit" value="设置">
<input type="reset" name="Submit2" value="重置"></td>
</tr>
</table>
</form>
<?php
$name=$_GET['name'];
$cid=$_GET['cid'];
$newdata = <<<php
<?php
$name = '{$name}';
$cid = '{$cid}';
php;
file_put_contents("config.php",$newdata);
?>
config.php内容:
<?php
$name = '张三';
$cid = '武汉';
还没有评论,来说两句吧...