This article describes how to use the COPY function to update the configuration file in php, and describes how to update the configuration information using the copy function, for more information about how to update the configuration file using the COPY function in php, refer to the next article. This article describes how to update the configuration file using the copy function.
This example describes how php updates the configuration file using the COPY function. Share it with you for your reference. The details are as follows:
The _ saveconfig. php file is as follows:
The config. php configuration file is as follows:
'Localhost', // host name 'user' => 'root', // username 'pwd' => '', // password 'DB' => 'Sino ', // database name 'prefix' => 'Sin _ '// database prefix); $ gSite = array ('sitename' => 'company name ', 'sitenameen' => 'We are the company', 'sitekeyword' => 'medicines, pharmaceuticals ', 'sitedescription' => 'company name is a 00 company '); $ gUpload = array ('dir' => 'upload', 'imagewidth' => '123 ', 'imageheight' => '*'); $ contactus = ''; $ menuhiddenp =" "; $ FROMURL = $ _ SERVER ["HTTP_REFERER"]? $ _ SERVER ["HTTP_REFERER"]: $ HTTP_SERVER_VARS ["HTTP_REFERER"]; $ dRootDir = '.. /'; $ conn = mysql_connect ($ gDb ['host'], $ gDb ['user'], $ gDb ['pwd']); mysql_select_db ($ gDb ['DB']) or die ('database connect error! '); Mysql_query ("set names 'gbk'");?>