欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

文件写入_PHP教程

程序员文章站 2024-02-17 22:50:17
...
//index.php 页面
$incpeizhi="inc.peizhi.php";
$arr=array('mark_h','mark_w','mark_name','mark_url','mark_type');
extract($_POST);
echo $mark_name;
echo "
";
$configstr = "";
foreach($arr as $v)
{
echo $v;
${$v} = str_replace("'","",${$v});
$configstr .= "\${$v} = '".${$v}."';\r\n";
}
$configstr = "\r\n";
$fp=fopen($incpeizhi,"w");
fwrite($fp,$configstr);
fclose($fp);

//=======================
//inc.peizhi.php 页面
$mark_h = '200';
$mark_w = '150';
$mark_name = 'xinxi';
$mark_url = 'www.2cto.com';
$mark_type = '1';
?>
//===================
//form页面

H:

W:

type:

url:

name:




摘自 chaojie2009的专栏

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478377.htmlTechArticle//index.php 页面 $incpeizhi=inc.peizhi.php; $arr=array(mark_h,mark_w,mark_name,mark_url,mark_type); extract($_POST); echo $mark_name; echo br; $configstr = ; foreach($arr as $v) {...