台灣最大程式設計社群網站
線上人數
1801
 
會員總數:246478
討論主題:189985
歡迎您免費加入會員
討論區列表 >> PHP >> 下載時自動產生斷行&編碼問題
[]  
[我要回覆]
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
下載時自動產生斷行&編碼問題
價值 : 50 QP  點閱數:2047 回應數:0
樓主

努力學習中
初學者
10 20
457 47
發送站內信

各位大大好,小弟有個問題解決不了想請教各位大大,當小弟寫入conf檔存放到磁碟時並沒產生斷行,但一下載後打開文件確是有斷行的,不曉得問題出在哪,還有小弟有用rawurlencode跟rawurldecode去編碼解碼,編碼ok,要上傳解碼時卻出現Warning: rawurldecode() expects parameter 1 to be string, array given in C:\Program Files\VertrigoServ\www\seye\upload.php on line 8,不知道問題出在哪,煩請各位大大幫忙解答,感謝各位大大,以下是小弟ㄉ程式碼∼
include_once 'global.php';
$seye=parse_ini_file(FILEPATH.SYSFILE,true);
$seyeview=parse_ini_file(FILEPATH.SYSVIEW,true);
$user=parse_ini_file(FILEPATH.USERFILE,true);
$ccd1=parse_ini_file(FILEPATH."ccd1.ini",true);
$ccd2=parse_ini_file(FILEPATH."ccd2.ini",true);
$ccd3=parse_ini_file(FILEPATH."ccd3.ini",true);
$ccd4=parse_ini_file(FILEPATH."ccd4.ini",true);
$ccd5=parse_ini_file(FILEPATH."ccd5.ini",true);
$ccd6=parse_ini_file(FILEPATH."ccd6.ini",true);
$ccd7=parse_ini_file(FILEPATH."ccd7.ini",true);
$ccd8=parse_ini_file(FILEPATH."ccd8.ini",true);
$apps=file(NTP_TIME.APPS,true);
$crontab=file(NTP_TIME.CRONTAB,true);
$ntp=file(NTP_SERVER.NTP,true);
$data=file(NTP_TIME.DATA,true);
$eth0=file(NTP_NETWORK."eth0",true);
$eth1=file(NTP_NETWORK."eth1",true);
//======================================================
$backup="====================seye====================\n";
$backup.="[common]\n";
$backup.="name=".$seye["common"]["name"]."\n";
$backup.="cam_count=".$seye["common"]["cam_count"]."\n";
$backup.="auto_delete=".$seye["common"]["auto_delete"]."\n";
$backup.="low_space=".$seye["common"]["low_space"]."\n";
$backup.="delete_day=".$seye["common"]["delete_day"]."\n";
$backup.="audio=".$seye["common"]["audio"]."\n";
$backup.="wdog_type=".$seye["common"]["wdog_type"]."\n";
$backup.="wdog_time=".$seye["common"]["wdog_time"]."\n";
$backup.="osdfont=".$seye["common"]["osdfont"]."\n";
$backup.="[ptz]"."\n";
$backup.="ptz=".$seye["ptz"]["ptz"]."\n";
$backup.="port=".$seye["ptz"]["port"]."\n";
$backup.="baudrate=".$seye["ptz"]["baudrate"]."\n";
$backup.="databits=".$seye["ptz"]["databits"]."\n";
$backup.="parity=".$seye["ptz"]["parity"]."\n";
$backup.="stopbits=".$seye["ptz"]["stopbits"]."\n";
$backup.="protocol=".$seye["ptz"]["protocol"]."\n";
$backup.="[modbus]"."\n";
$backup.="mode=".$seye["modbus"]["mode"]."\n";
$backup.="port=".$seye["modbus"]["port"]."\n";
$backup.="baudrate=".$seye["modbus"]["baudrate"]."\n";
$backup.="databits=".$seye["modbus"]["databits"]."\n";
$backup.="parity=".$seye["modbus"]["parity"]."\n";
$backup.="stopbits=".$seye["modbus"]["stopbits"]."\n";
$backup.="address=".$seye["modbus"]["address"]."\n";
$backup.="[motion]"."\n";
$backup.="trigger0=".$seye["motion"]["trigger0"]."\n";
$backup.="trigger1=".$seye["motion"]["trigger1"]."\n";
$backup.="pixel_threshold0=".$seye["motion"]["pixel_threshold0"]."\n";
$backup.="pixel_threshold1=".$seye["motion"]["pixel_threshold1"]."\n";
$backup.="motion_percent0=".$seye["motion"]["motion_percent0"]."\n";
$backup.="motion_percent1=".$seye["motion"]["motion_percent1"]."\n";
$backup.="====================seyeview====================\n";
$backup.="[common]\n";
$backup.="width=".$seyeview["common"]["width"]."\n";
$backup.="height=".$seyeview["common"]["height"]."\n";
$backup.="font=".$seyeview["common"]["font"]."\n";
$backup.="fontsize=".$seyeview["common"]["fontsize"]."\n";
$backup.="fontcolor=".$seyeview["common"]["fontcolor"]."\n";
$backup.="showtime=".$seyeview["common"]["showtime"]."\n";
$backup.="showname=".$seyeview["common"]["showname"]."\n";
$backup.="showfps=".$seyeview["common"]["showfps"]."\n";
$backup.="showborder=".$seyeview["common"]["showborder"]."\n";
$backup.="bordercolor=".$seyeview["common"]["bordercolor"]."\n";
$backup.="borderwidth=".$seyeview["common"]["borderwidth"]."\n";
$backup.="swapuv=".$seyeview["common"]["swapuv"]."\n";
$backup.="====================user====================\n";
$backup.="[common]\n";
$backup.="usercount=".$user["common"]["usercount"]."\n";
$i=0;
while($i<$user["common"]["usercount"])
{
$backup.="[user_$i]"."\n";
$backup.="name=".$user["user_$i"]["name"]."\n";
$backup.="password=".$user["user_$i"]["password"]."\n";
$backup.="right=".$user["user_$i"]["right"]."\n";
$backup.="mask=".$user["user_$i"]["mask"]."\n";
$i++;
}
$backup.="====================ccd1====================\n";
$backup.="[common]\n";
$backup.="name=".$ccd1["common"]["name"]."\n";
$backup.="norm=".$ccd1["common"]["norm"]."\n";
$backup.="width=".$ccd1["common"]["width"]."\n";
$backup.="height=".$ccd1["common"]["height"]."\n";
$backup.="vwidth=".$ccd1["common"]["vwidth"]."\n";
$backup.="vheight=".$ccd1["common"]["vheight"]."\n";
$backup.="signal_detection=".$ccd1["common"]["signal_detection"]."\n";
$backup.="motion_detection=".$ccd1["common"]["motion_detection"]."\n";
$backup.="detection_area=".$ccd1["common"]["detection_area"]."\n";
$backup.="sensitivity=".$ccd1["common"]["sensitivity"]."\n";
$backup.="pre_record_second=".$ccd1["common"]["pre_record_second"]."\n";
$backup.="record_time=".$ccd1["common"]["record_time"]."\n";
$backup.="schedule_record=".$ccd1["common"]["schedule_record"]."\n";
$backup.="normal_schedule=".$ccd1["common"]["normal_schedule"]."\n";
$backup.="holiday_schedule=".$ccd1["common"]["holiday_schedule"]."\n";
$backup.="pan_tilt_enabled=".$ccd1["common"]["pan_tilt_enabled"]."\n";
$backup.="auto_reposition=".$ccd1["common"]["auto_reposition"]."\n";
$backup.="auto_scan=".$ccd1["common"]["auto_scan"]."\n";
$backup.="quality=".$ccd1["common"]["quality"]."\n";
$backup.="kfc=".$ccd1["common"]["kfc"]."\n";
$backup.="fps=".$ccd1["common"]["fps"]."\n";
$backup.="mask_count=".$ccd1["common"]["mask_count"]."\n";
$i=0;
while($i<$ccd1["common"]["mask_count"])
{
$backup.="[mask_$i]"."\n";
$backup.="show=".$ccd1["mask_$i"]["show"]."\n";
$backup.="show=".$ccd1["mask_$i"]["left"]."\n";
$backup.="top=".$ccd1["mask_$i"]["top"]."\n";
$backup.="width=".$ccd1["mask_$i"]["width"]."\n";
$backup.="height=".$ccd1["mask_$i"]["height"]."\n";
$backup.="color=".$ccd1["mask_$i"]["color"]."\n";
$i++;
}
$backup.="[logo]"."\n";
$backup.="show=".$ccd1["logo"]["show"]."\n";
$backup.="left=".$ccd1["logo"]["left"]."\n";
$backup.="top=".$ccd1["logo"]["top"]."\n";
$backup.="width=".$ccd1["logo"]["width"]."\n";
$backup.="height=".$ccd1["logo"]["height"]."\n";
$backup.="blend=".$ccd1["logo"]["blend"]."\n";
$backup.="logo_icon=".$ccd1["logo"]["logo_icon"]."\n";
$backup.="[cam_time]"."\n";
$backup.="show=".$ccd1["cam_time"]["show"]."\n";
$backup.="left=".$ccd1["cam_time"]["left"]."\n";
$backup.="top=".$ccd1["cam_time"]["top"]."\n";
$backup.="size=".$ccd1["cam_time"]["size"]."\n";
$backup.="color=".$ccd1["cam_time"]["color"]."\n";
$backup.="background=".$ccd1["cam_time"]["background"]."\n";
$backup.="blend=".$ccd1["cam_time"]["blend"]."\n";
$backup.="fmt=".$ccd1["cam_time"]["fmt"]."\n";
$backup.="[cam_name]"."\n";
$backup.="show=".$ccd1["cam_name"]["show"]."\n";
$backup.="left=".$ccd1["cam_name"]["left"]."\n";
$backup.="top=".$ccd1["cam_name"]["top"]."\n";
$backup.="size=".$ccd1["cam_name"]["size"]."\n";
$backup.="background=".$ccd1["cam_name"]["background"]."\n";
$backup.="blend=".$ccd1["cam_name"]["blend"]."\n";
$backup.="color=".$ccd1["cam_name"]["color"]."\n";
$i=0;
while($i<24)
{
$backup.="[ptz_$i]"."\n";
$backup.="name=".$ccd1["ptz_$i"]["name"]."\n";
$backup.="ptz_on=".$ccd1["ptz_$i"]["ptz_on"]."\n";
$i++;
}
$backup.="====================ccd2====================\n";
$backup.="[common]\n";
$backup.="name=".$ccd2["common"]["name"]."\n";
$backup.="norm=".$ccd2["common"]["norm"]."\n";
$backup.="width=".$ccd2["common"]["width"]."\n";
$backup.="height=".$ccd2["common"]["height"]."\n";
$backup.="vwidth=".$ccd2["common"]["vwidth"]."\n";
$backup.="vheight=".$ccd2["common"]["vheight"]."\n";
$backup.="signal_detection=".$ccd2["common"]["signal_detection"]."\n";
$backup.="motion_detection=".$ccd2["common"]["motion_detection"]."\n";
$backup.="detection_area=".$ccd2["common"]["detection_area"]."\n";
$backup.="sensitivity=".$ccd2["common"]["sensitivity"]."\n";
$backup.="pre_record_second=".$ccd2["common"]["pre_record_second"]."\n";
$backup.="record_time=".$ccd2["common"]["record_time"]."\n";
$backup.="schedule_record=".$ccd2["common"]["schedule_record"]."\n";
$backup.="normal_schedule=".$ccd2["common"]["normal_schedule"]."\n";
$backup.="holiday_schedule=".$ccd2["common"]["holiday_schedule"]."\n";
$backup.="pan_tilt_enabled=".$ccd2["common"]["pan_tilt_enabled"]."\n";
$backup.="auto_reposition=".$ccd2["common"]["auto_reposition"]."\n";
$backup.="auto_scan=".$ccd2["common"]["auto_scan"]."\n";
$backup.="quality=".$ccd2["common"]["quality"]."\n";
$backup.="kfc=".$ccd2["common"]["kfc"]."\n";
$backup.="fps=".$ccd2["common"]["fps"]."\n";
$backup.="mask_count=".$ccd2["common"]["mask_count"]."\n";
$i=0;
while($i<$ccd2["common"]["mask_count"])
{
$backup.="[mask_$i]"."\n";
$backup.="show=".$ccd2["mask_$i"]["show"]."\n";
$backup.="show=".$ccd2["mask_$i"]["left"]."\n";
$backup.="top=".$ccd2["mask_$i"]["top"]."\n";
$backup.="width=".$ccd2["mask_$i"]["width"]."\n";
$backup.="height=".$ccd2["mask_$i"]["height"]."\n";
$backup.="color=".$ccd2["mask_$i"]["color"]."\n";
$i++;
}
$backup.="[logo]"."\n";
$backup.="show=".$ccd2["logo"]["show"]."\n";
$backup.="left=".$ccd2["logo"]["left"]."\n";
$backup.="top=".$ccd2["logo"]["top"]."\n";
$backup.="width=".$ccd2["logo"]["width"]."\n";
$backup.="height=".$ccd2["logo"]["height"]."\n";
$backup.="blend=".$ccd2["logo"]["blend"]."\n";
$backup.="logo_icon=".$ccd2["logo"]["logo_icon"]."\n";
$backup.="[cam_time]"."\n";
$backup.="show=".$ccd2["cam_time"]["show"]."\n";
$backup.="left=".$ccd2["cam_time"]["left"]."\n";
$backup.="top=".$ccd2["cam_time"]["top"]."\n";
$backup.="size=".$ccd2["cam_time"]["size"]."\n";
$backup.="color=".$ccd2["cam_time"]["color"]."\n";
$backup.="background=".$ccd2["cam_time"]["background"]."\n";
$backup.="blend=".$ccd2["cam_time"]["blend"]."\n";
$backup.="fmt=".$ccd2["cam_time"]["fmt"]."\n";
$backup.="[cam_name]"."\n";
$backup.="show=".$ccd2["cam_name"]["show"]."\n";
$backup.="left=".$ccd2["cam_name"]["left"]."\n";
$backup.="top=".$ccd2["cam_name"]["top"]."\n";
$backup.="size=".$ccd2["cam_name"]["size"]."\n";
$backup.="background=".$ccd2["cam_name"]["background"]."\n";
$backup.="blend=".$ccd2["cam_name"]["blend"]."\n";
$backup.="color=".$ccd2["cam_name"]["color"]."\n";
$i=0;
while($i<24)
{
$backup.="[ptz_$i]"."\n";
$backup.="name=".$ccd2["ptz_$i"]["name"]."\n";
$backup.="ptz_on=".$ccd2["ptz_$i"]["ptz_on"]."\n";
$i++;
}
$backup.="====================ccd3====================\n";
$backup.="[common]\n";
$backup.="name=".$ccd3["common"]["name"]."\n";
$backup.="norm=".$ccd3["common"]["norm"]."\n";
$backup.="width=".$ccd3["common"]["width"]."\n";
$backup.="height=".$ccd3["common"]["height"]."\n";
$backup.="vwidth=".$ccd3["common"]["vwidth"]."\n";
$backup.="vheight=".$ccd3["common"]["vheight"]."\n";
$backup.="signal_detection=".$ccd3["common"]["signal_detection"]."\n";
$backup.="motion_detection=".$ccd3["common"]["motion_detection"]."\n";
$backup.="detection_area=".$ccd3["common"]["detection_area"]."\n";
$backup.="sensitivity=".$ccd3["common"]["sensitivity"]."\n";
$backup.="pre_record_second=".$ccd3["common"]["pre_record_second"]."\n";
$backup.="record_time=".$ccd3["common"]["record_time"]."\n";
$backup.="schedule_record=".$ccd3["common"]["schedule_record"]."\n";
$backup.="normal_schedule=".$ccd3["common"]["normal_schedule"]."\n";
$backup.="holiday_schedule=".$ccd3["common"]["holiday_schedule"]."\n";
$backup.="pan_tilt_enabled=".$ccd3["common"]["pan_tilt_enabled"]."\n";
$backup.="auto_reposition=".$ccd3["common"]["auto_reposition"]."\n";
$backup.="auto_scan=".$ccd3["common"]["auto_scan"]."\n";
$backup.="quality=".$ccd3["common"]["quality"]."\n";
$backup.="kfc=".$ccd3["common"]["kfc"]."\n";
$backup.="fps=".$ccd3["common"]["fps"]."\n";
$backup.="mask_count=".$ccd3["common"]["mask_count"]."\n";
$i=0;
while($i<$ccd3["common"]["mask_count"])
{
$backup.="[mask_$i]"."\n";
$backup.="show=".$ccd3["mask_$i"]["show"]."\n";
$backup.="show=".$ccd3["mask_$i"]["left"]."\n";
$backup.="top=".$ccd3["mask_$i"]["top"]."\n";
$backup.="width=".$ccd3["mask_$i"]["width"]."\n";
$backup.="height=".$ccd3["mask_$i"]["height"]."\n";
$backup.="color=".$ccd3["mask_$i"]["color"]."\n";
$i++;
}
$backup.="[logo]"."\n";
$backup.="show=".$ccd3["logo"]["show"]."\n";
$backup.="left=".$ccd3["logo"]["left"]."\n";
$backup.="top=".$ccd3["logo"]["top"]."\n";
$backup.="width=".$ccd3["logo"]["width"]."\n";
$backup.="height=".$ccd3["logo"]["height"]."\n";
$backup.="blend=".$ccd3["logo"]["blend"]."\n";
$backup.="logo_icon=".$ccd3["logo"]["logo_icon"]."\n";
$backup.="[cam_time]"."\n";
$backup.="show=".$ccd3["cam_time"]["show"]."\n";
$backup.="left=".$ccd3["cam_time"]["left"]."\n";
$backup.="top=".$ccd3["cam_time"]["top"]."\n";
$backup.="size=".$ccd3["cam_time"]["size"]."\n";
$backup.="color=".$ccd3["cam_time"]["color"]."\n";
$backup.="background=".$ccd3["cam_time"]["background"]."\n";
$backup.="blend=".$ccd3["cam_time"]["blend"]."\n";
$backup.="fmt=".$ccd3["cam_time"]["fmt"]."\n";
$backup.="[cam_name]"."\n";
$backup.="show=".$ccd3["cam_name"]["show"]."\n";
$backup.="left=".$ccd3["cam_name"]["left"]."\n";
$backup.="top=".$ccd3["cam_name"]["top"]."\n";
$backup.="size=".$ccd3["cam_name"]["size"]."\n";
$backup.="background=".$ccd3["cam_name"]["background"]."\n";
$backup.="blend=".$ccd3["cam_name"]["blend"]."\n";
$backup.="color=".$ccd3["cam_name"]["color"]."\n";
$i=0;
while($i<24)
{
$backup.="[ptz_$i]"."\n";
$backup.="name=".$ccd3["ptz_$i"]["name"]."\n";
$backup.="ptz_on=".$ccd3["ptz_$i"]["ptz_on"]."\n";
$i++;
}
$backup.="====================ccd4====================\n";
$backup.="[common]\n";
$backup.="name=".$ccd4["common"]["name"]."\n";
$backup.="norm=".$ccd4["common"]["norm"]."\n";
$backup.="width=".$ccd4["common"]["width"]."\n";
$backup.="height=".$ccd4["common"]["height"]."\n";
$backup.="vwidth=".$ccd4["common"]["vwidth"]."\n";
$backup.="vheight=".$ccd4["common"]["vheight"]."\n";
$backup.="signal_detection=".$ccd4["common"]["signal_detection"]."\n";
$backup.="motion_detection=".$ccd4["common"]["motion_detection"]."\n";
$backup.="detection_area=".$ccd4["common"]["detection_area"]."\n";
$backup.="sensitivity=".$ccd4["common"]["sensitivity"]."\n";
$backup.="pre_record_second=".$ccd4["common"]["pre_record_second"]."\n";
$backup.="record_time=".$ccd4["common"]["record_time"]."\n";
$backup.="schedule_record=".$ccd4["common"]["schedule_record"]."\n";
$backup.="normal_schedule=".$ccd4["common"]["normal_schedule"]."\n";
$backup.="holiday_schedule=".$ccd4["common"]["holiday_schedule"]."\n";
$backup.="pan_tilt_enabled=".$ccd4["common"]["pan_tilt_enabled"]."\n";
$backup.="auto_reposition=".$ccd4["common"]["auto_reposition"]."\n";
$backup.="auto_scan=".$ccd4["common"]["auto_scan"]."\n";
$backup.="quality=".$ccd4["common"]["quality"]."\n";
$backup.="kfc=".$ccd4["common"]["kfc"]."\n";
$backup.="fps=".$ccd4["common"]["fps"]."\n";
$backup.="mask_count=".$ccd4["common"]["mask_count"]."\n";
$i=0;
while($i<$ccd4["common"]["mask_count"])
{
$backup.="[mask_$i]"."\n";
$backup.="show=".$ccd4["mask_$i"]["show"]."\n";
$backup.="show=".$ccd4["mask_$i"]["left"]."\n";
$backup.="top=".$ccd4["mask_$i"]["top"]."\n";
$backup.="width=".$ccd4["mask_$i"]["width"]."\n";
$backup.="height=".$ccd4["mask_$i"]["height"]."\n";
$backup.="color=".$ccd4["mask_$i"]["color"]."\n";
$i++;
}
$backup.="[logo]"."\n";
$backup.="show=".$ccd4["logo"]["show"]."\n";
$backup.="left=".$ccd4["logo"]["left"]."\n";
$backup.="top=".$ccd4["logo"]["top"]."\n";
$backup.="width=".$ccd4["logo"]["width"]."\n";
$backup.="height=".$ccd4["logo"]["height"]."\n";
$backup.="blend=".$ccd4["logo"]["blend"]."\n";
$backup.="logo_icon=".$ccd4["logo"]["logo_icon"]."\n";
$backup.="[cam_time]"."\n";
$backup.="show=".$ccd4["cam_time"]["show"]."\n";
$backup.="left=".$ccd4["cam_time"]["left"]."\n";
$backup.="top=".$ccd4["cam_time"]["top"]."\n";
$backup.="size=".$ccd4["cam_time"]["size"]."\n";
$backup.="color=".$ccd4["cam_time"]["color"]."\n";
$backup.="background=".$ccd4["cam_time"]["background"]."\n";
$backup.="blend=".$ccd4["cam_time"]["blend"]."\n";
$backup.="fmt=".$ccd4["cam_time"]["fmt"]."\n";
$backup.="[cam_name]"."\n";
$backup.="show=".$ccd4["cam_name"]["show"]."\n";
$backup.="left=".$ccd4["cam_name"]["left"]."\n";
$backup.="top=".$ccd4["cam_name"]["top"]."\n";
$backup.="size=".$ccd4["cam_name"]["size"]."\n";
$backup.="background=".$ccd4["cam_name"]["background"]."\n";
$backup.="blend=".$ccd4["cam_name"]["blend"]."\n";
$backup.="color=".$ccd4["cam_name"]["color"]."\n";
$i=0;
while($i<24)
{
$backup.="[ptz_$i]"."\n";
$backup.="name=".$ccd4["ptz_$i"]["name"]."\n";
$backup.="ptz_on=".$ccd4["ptz_$i"]["ptz_on"]."\n";
$i++;
}
$backup.="====================ccd5====================\n";
$backup.="[common]\n";
$backup.="name=".$ccd5["common"]["name"]."\n";
$backup.="norm=".$ccd5["common"]["norm"]."\n";
$backup.="width=".$ccd5["common"]["width"]."\n";
$backup.="height=".$ccd5["common"]["height"]."\n";
$backup.="vwidth=".$ccd5["common"]["vwidth"]."\n";
$backup.="vheight=".$ccd5["common"]["vheight"]."\n";
$backup.="signal_detection=".$ccd5["common"]["signal_detection"]."\n";
$backup.="motion_detection=".$ccd5["common"]["motion_detection"]."\n";
$backup.="detection_area=".$ccd5["common"]["detection_area"]."\n";
$backup.="sensitivity=".$ccd5["common"]["sensitivity"]."\n";
$backup.="pre_record_second=".$ccd5["common"]["pre_record_second"]."\n";
$backup.="record_time=".$ccd5["common"]["record_time"]."\n";
$backup.="schedule_record=".$ccd5["common"]["schedule_record"]."\n";
$backup.="normal_schedule=".$ccd5["common"]["normal_schedule"]."\n";
$backup.="holiday_schedule=".$ccd5["common"]["holiday_schedule"]."\n";
$backup.="pan_tilt_enabled=".$ccd5["common"]["pan_tilt_enabled"]."\n";
$backup.="auto_reposition=".$ccd5["common"]["auto_reposition"]."\n";
$backup.="auto_scan=".$ccd5["common"]["auto_scan"]."\n";
$backup.="quality=".$ccd5["common"]["quality"]."\n";
$backup.="kfc=".$ccd5["common"]["kfc"]."\n";
$backup.="fps=".$ccd5["common"]["fps"]."\n";
$backup.="mask_count=".$ccd5["common"]["mask_count"]."\n";
$i=0;
while($i<$ccd5["common"]["mask_count"])
{
$backup.="[mask_$i]"."\n";
$backup.="show=".$ccd5["mask_$i"]["show"]."\n";
$backup.="show=".$ccd5["mask_$i"]["left"]."\n";
$backup.="top=".$ccd5["mask_$i"]["top"]."\n";
$backup.="width=".$ccd5["mask_$i"]["width"]."\n";
$backup.="height=".$ccd5["mask_$i"]["height"]."\n";
$backup.="color=".$ccd5["mask_$i"]["color"]."\n";
$i++;
}
$backup.="[logo]"."\n";
$backup.="show=".$ccd5["logo"]["show"]."\n";
$backup.="left=".$ccd5["logo"]["left"]."\n";
$backup.="top=".$ccd5["logo"]["top"]."\n";
$backup.="width=".$ccd5["logo"]["width"]."\n";
$backup.="height=".$ccd5["logo"]["height"]."\n";
$backup.="blend=".$ccd5["logo"]["blend"]."\n";
$backup.="logo_icon=".$ccd5["logo"]["logo_icon"]."\n";
$backup.="[cam_time]"."\n";
$backup.="show=".$ccd5["cam_time"]["show"]."\n";
$backup.="left=".$ccd5["cam_time"]["left"]."\n";
$backup.="top=".$ccd5["cam_time"]["top"]."\n";
$backup.="size=".$ccd5["cam_time"]["size"]."\n";
$backup.="color=".$ccd5["cam_time"]["color"]."\n";
$backup.="background=".$ccd5["cam_time"]["background"]."\n";
$backup.="blend=".$ccd5["cam_time"]["blend"]."\n";
$backup.="fmt=".$ccd5["cam_time"]["fmt"]."\n";
$backup.="[cam_name]"."\n";
$backup.="show=".$ccd5["cam_name"]["show"]."\n";
$backup.="left=".$ccd5["cam_name"]["left"]."\n";
$backup.="top=".$ccd5["cam_name"]["top"]."\n";
$backup.="size=".$ccd5["cam_name"]["size"]."\n";
$backup.="background=".$ccd5["cam_name"]["background"]."\n";
$backup.="blend=".$ccd5["cam_name"]["blend"]."\n";
$backup.="color=".$ccd5["cam_name"]["color"]."\n";
$i=0;
while($i<24)
{
$backup.="[ptz_$i]"."\n";
$backup.="name=".$ccd5["ptz_$i"]["name"]."\n";
$backup.="ptz_on=".$ccd5["ptz_$i"]["ptz_on"]."\n";
$i++;
}
$backup.="====================ccd6====================\n";
$backup.="[common]\n";
$backup.="name=".$ccd6["common"]["name"]."\n";
$backup.="norm=".$ccd6["common"]["norm"]."\n";
$backup.="width=".$ccd6["common"]["width"]."\n";
$backup.="height=".$ccd6["common"]["height"]."\n";
$backup.="vwidth=".$ccd6["common"]["vwidth"]."\n";
$backup.="vheight=".$ccd6["common"]["vheight"]."\n";
$backup.="signal_detection=".$ccd6["common"]["signal_detection"]."\n";
$backup.="motion_detection=".$ccd6["common"]["motion_detection"]."\n";
$backup.="detection_area=".$ccd6["common"]["detection_area"]."\n";
$backup.="sensitivity=".$ccd6["common"]["sensitivity"]."\n";
$backup.="pre_record_second=".$ccd6["common"]["pre_record_second"]."\n";
$backup.="record_time=".$ccd6["common"]["record_time"]."\n";
$backup.="schedule_record=".$ccd6["common"]["schedule_record"]."\n";
$backup.="normal_schedule=".$ccd6["common"]["normal_schedule"]."\n";
$backup.="holiday_schedule=".$ccd6["common"]["holiday_schedule"]."\n";
$backup.="pan_tilt_enabled=".$ccd6["common"]["pan_tilt_enabled"]."\n";
$backup.="auto_reposition=".$ccd6["common"]["auto_reposition"]."\n";
$backup.="auto_scan=".$ccd6["common"]["auto_scan"]."\n";
$backup.="quality=".$ccd6["common"]["quality"]."\n";
$backup.="kfc=".$ccd6["common"]["kfc"]."\n";
$backup.="fps=".$ccd6["common"]["fps"]."\n";
$backup.="mask_count=".$ccd6["common"]["mask_count"]."\n";
$i=0;
while($i<$ccd6["common"]["mask_count"])
{
$backup.="[mask_$i]"."\n";
$backup.="show=".$ccd6["mask_$i"]["show"]."\n";
$backup.="show=".$ccd6["mask_$i"]["left"]."\n";
$backup.="top=".$ccd6["mask_$i"]["top"]."\n";
$backup.="width=".$ccd6["mask_$i"]["width"]."\n";
$backup.="height=".$ccd6["mask_$i"]["height"]."\n";
$backup.="color=".$ccd6["mask_$i"]["color"]."\n";
$i++;
}
$backup.="[logo]"."\n";
$backup.="show=".$ccd6["logo"]["show"]."\n";
$backup.="left=".$ccd6["logo"]["left"]."\n";
$backup.="top=".$ccd6["logo"]["top"]."\n";
$backup.="width=".$ccd6["logo"]["width"]."\n";
$backup.="height=".$ccd6["logo"]["height"]."\n";
$backup.="blend=".$ccd6["logo"]["blend"]."\n";
$backup.="logo_icon=".$ccd6["logo"]["logo_icon"]."\n";
$backup.="[cam_time]"."\n";
$backup.="show=".$ccd6["cam_time"]["show"]."\n";
$backup.="left=".$ccd6["cam_time"]["left"]."\n";
$backup.="top=".$ccd6["cam_time"]["top"]."\n";
$backup.="size=".$ccd6["cam_time"]["size"]."\n";
$backup.="color=".$ccd6["cam_time"]["color"]."\n";
$backup.="background=".$ccd6["cam_time"]["background"]."\n";
$backup.="blend=".$ccd6["cam_time"]["blend"]."\n";
$backup.="fmt=".$ccd6["cam_time"]["fmt"]."\n";
$backup.="[cam_name]"."\n";
$backup.="show=".$ccd6["cam_name"]["show"]."\n";
$backup.="left=".$ccd6["cam_name"]["left"]."\n";
$backup.="top=".$ccd6["cam_name"]["top"]."\n";
$backup.="size=".$ccd6["cam_name"]["size"]."\n";
$backup.="background=".$ccd6["cam_name"]["background"]."\n";
$backup.="blend=".$ccd6["cam_name"]["blend"]."\n";
$backup.="color=".$ccd6["cam_name"]["color"]."\n";
$i=0;
while($i<24)
{
$backup.="[ptz_$i]"."\n";
$backup.="name=".$ccd6["ptz_$i"]["name"]."\n";
$backup.="ptz_on=".$ccd6["ptz_$i"]["ptz_on"]."\n";
$i++;
}
$backup.="====================ccd7====================\n";
$backup.="[common]\n";
$backup.="name=".$ccd7["common"]["name"]."\n";
$backup.="norm=".$ccd7["common"]["norm"]."\n";
$backup.="width=".$ccd7["common"]["width"]."\n";
$backup.="height=".$ccd7["common"]["height"]."\n";
$backup.="vwidth=".$ccd7["common"]["vwidth"]."\n";
$backup.="vheight=".$ccd7["common"]["vheight"]."\n";
$backup.="signal_detection=".$ccd7["common"]["signal_detection"]."\n";
$backup.="motion_detection=".$ccd7["common"]["motion_detection"]."\n";
$backup.="detection_area=".$ccd7["common"]["detection_area"]."\n";
$backup.="sensitivity=".$ccd7["common"]["sensitivity"]."\n";
$backup.="pre_record_second=".$ccd7["common"]["pre_record_second"]."\n";
$backup.="record_time=".$ccd7["common"]["record_time"]."\n";
$backup.="schedule_record=".$ccd7["common"]["schedule_record"]."\n";
$backup.="normal_schedule=".$ccd7["common"]["normal_schedule"]."\n";
$backup.="holiday_schedule=".$ccd7["common"]["holiday_schedule"]."\n";
$backup.="pan_tilt_enabled=".$ccd7["common"]["pan_tilt_enabled"]."\n";
$backup.="auto_reposition=".$ccd7["common"]["auto_reposition"]."\n";
$backup.="auto_scan=".$ccd7["common"]["auto_scan"]."\n";
$backup.="quality=".$ccd7["common"]["quality"]."\n";
$backup.="kfc=".$ccd7["common"]["kfc"]."\n";
$backup.="fps=".$ccd7["common"]["fps"]."\n";
$backup.="mask_count=".$ccd7["common"]["mask_count"]."\n";
$i=0;
while($i<$ccd7["common"]["mask_count"])
{
$backup.="[mask_$i]"."\n";
$backup.="show=".$ccd7["mask_$i"]["show"]."\n";
$backup.="show=".$ccd7["mask_$i"]["left"]."\n";
$backup.="top=".$ccd7["mask_$i"]["top"]."\n";
$backup.="width=".$ccd7["mask_$i"]["width"]."\n";
$backup.="height=".$ccd7["mask_$i"]["height"]."\n";
$backup.="color=".$ccd7["mask_$i"]["color"]."\n";
$i++;
}
$backup.="[logo]"."\n";
$backup.="show=".$ccd7["logo"]["show"]."\n";
$backup.="left=".$ccd7["logo"]["left"]."\n";
$backup.="top=".$ccd7["logo"]["top"]."\n";
$backup.="width=".$ccd7["logo"]["width"]."\n";
$backup.="height=".$ccd7["logo"]["height"]."\n";
$backup.="blend=".$ccd7["logo"]["blend"]."\n";
$backup.="logo_icon=".$ccd7["logo"]["logo_icon"]."\n";
$backup.="[cam_time]"."\n";
$backup.="show=".$ccd7["cam_time"]["show"]."\n";
$backup.="left=".$ccd7["cam_time"]["left"]."\n";
$backup.="top=".$ccd7["cam_time"]["top"]."\n";
$backup.="size=".$ccd7["cam_time"]["size"]."\n";
$backup.="color=".$ccd7["cam_time"]["color"]."\n";
$backup.="background=".$ccd7["cam_time"]["background"]."\n";
$backup.="blend=".$ccd7["cam_time"]["blend"]."\n";
$backup.="fmt=".$ccd7["cam_time"]["fmt"]."\n";
$backup.="[cam_name]"."\n";
$backup.="show=".$ccd7["cam_name"]["show"]."\n";
$backup.="left=".$ccd7["cam_name"]["left"]."\n";
$backup.="top=".$ccd7["cam_name"]["top"]."\n";
$backup.="size=".$ccd7["cam_name"]["size"]."\n";
$backup.="background=".$ccd7["cam_name"]["background"]."\n";
$backup.="blend=".$ccd7["cam_name"]["blend"]."\n";
$backup.="color=".$ccd7["cam_name"]["color"]."\n";
$i=0;
while($i<24)
{
$backup.="[ptz_$i]"."\n";
$backup.="name=".$ccd7["ptz_$i"]["name"]."\n";
$backup.="ptz_on=".$ccd7["ptz_$i"]["ptz_on"]."\n";
$i++;
}
$backup.="====================ccd8====================\n";
$backup.="[common]\n";
$backup.="name=".$ccd8["common"]["name"]."\n";
$backup.="norm=".$ccd8["common"]["norm"]."\n";
$backup.="width=".$ccd8["common"]["width"]."\n";
$backup.="height=".$ccd8["common"]["height"]."\n";
$backup.="vwidth=".$ccd8["common"]["vwidth"]."\n";
$backup.="vheight=".$ccd8["common"]["vheight"]."\n";
$backup.="signal_detection=".$ccd8["common"]["signal_detection"]."\n";
$backup.="motion_detection=".$ccd8["common"]["motion_detection"]."\n";
$backup.="detection_area=".$ccd8["common"]["detection_area"]."\n";
$backup.="sensitivity=".$ccd8["common"]["sensitivity"]."\n";
$backup.="pre_record_second=".$ccd8["common"]["pre_record_second"]."\n";
$backup.="record_time=".$ccd8["common"]["record_time"]."\n";
$backup.="schedule_record=".$ccd8["common"]["schedule_record"]."\n";
$backup.="normal_schedule=".$ccd8["common"]["normal_schedule"]."\n";
$backup.="holiday_schedule=".$ccd8["common"]["holiday_schedule"]."\n";
$backup.="pan_tilt_enabled=".$ccd8["common"]["pan_tilt_enabled"]."\n";
$backup.="auto_reposition=".$ccd8["common"]["auto_reposition"]."\n";
$backup.="auto_scan=".$ccd8["common"]["auto_scan"]."\n";
$backup.="quality=".$ccd8["common"]["quality"]."\n";
$backup.="kfc=".$ccd8["common"]["kfc"]."\n";
$backup.="fps=".$ccd8["common"]["fps"]."\n";
$backup.="mask_count=".$ccd8["common"]["mask_count"]."\n";
$i=0;
while($i<$ccd8["common"]["mask_count"])
{
$backup.="[mask_$i]"."\n";
$backup.="show=".$ccd8["mask_$i"]["show"]."\n";
$backup.="show=".$ccd8["mask_$i"]["left"]."\n";
$backup.="top=".$ccd8["mask_$i"]["top"]."\n";
$backup.="width=".$ccd8["mask_$i"]["width"]."\n";
$backup.="height=".$ccd8["mask_$i"]["height"]."\n";
$backup.="color=".$ccd8["mask_$i"]["color"]."\n";
$i++;
}
$backup.="[logo]"."\n";
$backup.="show=".$ccd8["logo"]["show"]."\n";
$backup.="left=".$ccd8["logo"]["left"]."\n";
$backup.="top=".$ccd8["logo"]["top"]."\n";
$backup.="width=".$ccd8["logo"]["width"]."\n";
$backup.="height=".$ccd8["logo"]["height"]."\n";
$backup.="blend=".$ccd8["logo"]["blend"]."\n";
$backup.="logo_icon=".$ccd8["logo"]["logo_icon"]."\n";
$backup.="[cam_time]"."\n";
$backup.="show=".$ccd8["cam_time"]["show"]."\n";
$backup.="left=".$ccd8["cam_time"]["left"]."\n";
$backup.="top=".$ccd8["cam_time"]["top"]."\n";
$backup.="size=".$ccd8["cam_time"]["size"]."\n";
$backup.="color=".$ccd8["cam_time"]["color"]."\n";
$backup.="background=".$ccd8["cam_time"]["background"]."\n";
$backup.="blend=".$ccd8["cam_time"]["blend"]."\n";
$backup.="fmt=".$ccd8["cam_time"]["fmt"]."\n";
$backup.="[cam_name]"."\n";
$backup.="show=".$ccd8["cam_name"]["show"]."\n";
$backup.="left=".$ccd8["cam_name"]["left"]."\n";
$backup.="top=".$ccd8["cam_name"]["top"]."\n";
$backup.="size=".$ccd8["cam_name"]["size"]."\n";
$backup.="background=".$ccd8["cam_name"]["background"]."\n";
$backup.="blend=".$ccd8["cam_name"]["blend"]."\n";
$backup.="color=".$ccd8["cam_name"]["color"]."\n";
$i=0;
while($i<24)
{
$backup.="[ptz_$i]"."\n";
$backup.="name=".$ccd8["ptz_$i"]["name"]."\n";
$backup.="ptz_on=".$ccd8["ptz_$i"]["ptz_on"]."\n";
$i++;
}
$backup.="====================apps====================\n";
$backup.=$apps[0];
$backup.="0=".$apps[1];
$backup.="1=".$apps[2];
$backup.="2=".$apps[3];
$backup.="====================crontab====================\n";
$backup.="0=".$crontab[0];
$backup.="1=".$crontab[1];
$backup.="2=".$crontab[2];
$backup.="3=".$crontab[3];
$backup.="4=".$crontab[4];
$backup.="5=".$crontab[5];
$backup.="6=".$crontab[6];
$backup.="7=".$crontab[7];
$backup.="8=".$crontab[8];
$backup.="9=".$crontab[9];
$backup.="10=".$crontab[10]."\n";
$backup.="====================ntp====================\n";
$backup.="0=".$ntp[0];
$backup.="1=".$ntp[1];
$backup.="2=".$ntp[2];
$backup.="3=".$ntp[3];
$backup.="====================data====================\n";
$backup.="0=".$data[0];
$backup.="====================eth0====================\n";
$backup.="0=".$eth0[0];
$backup.="1=".$eth0[1];
$backup.="2=".$eth0[2];
$backup.="3=".$eth0[3];
$backup.="====================eth1====================\n";
$backup.="0=".$eth1[0];
$backup.="1=".$eth1[1];
$backup.="2=".$eth1[2];
$backup.="3=".$eth1[3];
//===============================================================
$backup=rawurlencode($backup);
$file="backup/backup.conf";
if(file_put_contents("backup/backup.conf",$backup))
{
header("Content-type:application");
header("Content-Disposition: attachment; filename=backup.conf");
readfile($file);
exit(0);
}else{
echo "<script language=javascript>";
echo "alert(backup error!)";
echo "</script>";
}

ps:這樣的寫法可否使用parse_ini_file讀取?

本篇文章發表於2007-05-04 17:03
目前尚無任何回覆
   

回覆
如要回應,請先登入.