Php batch modify rarfile annotation code (1/2) _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.