Php batch modify the rarfile comment code (12 ). Add all *. hlp files from the current folder to the winrarahelp *. hlp file in help.rar. you can use the-z file switch to add comments from the file. Winrarc-zinfo.txtdummy, we add all *. hlp files from the current folder to the compressed file help.rar.
Winrar a help *. hlp
You can use-z to add comments from a file. <文件> Switch.
Winrar c -zinfo.txt dummy
In this way, we can use the php Tutorial to call cmd and run the above two winrar parameters to modify the comments of the rarfile in batches and add the files of the compressed package. note that cmd cannot be called directly When php is enabled in safe mode.
All scripts are in the same directory as 1.php.
$ Id = $ _ get [id];
If ($ id = "")
{
Echo "Parameter error ";
Exit;
}
If ($ id> = 400)
{
Echo "all ends ";
Exit;
}
$ Db = odbc_connect ("dw ","","");
$ SQL = "select * from 'download' where 'id' = $ id ";
$ Query = odbc_exec ($ db, $ SQL );
$ Filename = odbc_result ($ query, 2 );
If ($ filename = "")
{
}
$ Filename = str_replace ("# 1'," ", $ filename );
$ Filename = str_replace ("# 2',", $ filename );
$ Filename = "soft/". $ filename;
Echo $ filename ."
";
If (! File_exists ($ filename ))
{
Echo "the file does not exist, go to the next id ";
$ Id ++;
Echo"
Content = '0; url = ../test/1.php? Id = $ ID'> ";
Exit;
} // Read the file name and check whether the file exists
Else
{
'Winrar a $ filename use description .txt ';
Echo "the file is successfully inserted ";
$ Id ++;
Echo" ";
}
Odbc_close ($ db );
?>
*
Collection has become popular recently. many friends may try to build a site with rich content by collecting data.
However, in some cases, the rarfiles we normally collect are added with comments in batches. in this case, if we put the data on our own website, it would be tantamount to advertising for others.
Recently, I also encountered such a problem, which was a big headache. later, I carefully looked at the winrar help file and found that we can use the following methods to make batch modifications.
To open the winrar help file, we mentioned in the help file that the two parameters for modifying the rarfile comment in command line mode and adding the compressed file are ac. the description file of winrar is as follows:
Add all *. hlp files from the current folder to the compressed file help.rar.
Winrar a help *. hlp
You can use-z to add comments from a file. <文件> Switch.
Winrar c -zinfo.txt dummy
1 2
You can use the-z file switch to add comments from the winrar a help *. hlp file to the compressed file help.rar. Winrar c -zinfo.txt dummy, we...