I recently used PHP Open SourceProgramI made a website and found that an error occurred while downloading the FTP file. So I checked plus/download. php to exclude it one by one, and finally found that it was the second to the last line.CodeError.
Header("Location :{$ Softurl}");Exit();
I have never systematically studied PHP, so I am not very familiar with it. I searched for it and learned the role of the header function here, I also searched for the PHP header FTP error page, found a similar problem http://topic.csdn.net/t/20060415/12/4688825.html
So I referred to his practice and used
Echo"<Meta HTTP-EQUIV = Refresh content = '0; url = {$ Softurl} '> ";
As a download, but now the http: // file has an error, but FTP can be downloaded normally, so I combined the two to make a judgment
If(Preg_match("# ^ Thunder: \/| ^ ftp: \/| ^ flashget: \/# I ",$ Softurl)){Echo"<Meta HTTP-EQUIV = Refresh content = '0; url = {$ Softurl} '>";Exit();}Header("Location :{$ Softurl}");Exit();
You can download all the tests in this way. If you have a better method, please feel free to talk about it. Thank you. I am a rookie in PHP. What is wrong? Please point out.
Phpcms V9 also has similar problems. The solution is the same:
Find the file modules/content/down. php
Find the Code:
// Remote File If ( Strpos ( $ Fileurl ,':/')&&( Strpos ( $ Fileurl , Pc_base: load_config ('system', 'upload _ url') = False )){ Header ("Location: $ Fileurl " );} Else { If ($ D = 0 ){ Header ("Location :". $ Fileurl );} Else { $ Fileurl = Str_replace ( Array (Pc_base: load_config ('system', 'upload _ url '),'/'), Array (Pc_base: load_config ('system', 'upload _ path'), directory_separator ), $ Fileurl ); $ Filename = Basename ( $ Fileurl );
To:
// Remote File If ( Strpos ( $ Fileurl ,':/')&&( Strpos ( $ Fileurl , Pc_base: load_config ('system', 'upload _ url') = False )){ If ( Preg_match ("# ^ Thunder: \/| ^ ed2k :\/ \/| ^ ftp: \/| ^ flashget: \/# I ", $ Fileurl )){ Echo "<Meta HTTP-EQUIV = Refresh content = '0; url = $ Fileurl '>" ; Exit ();} Header ("Location: $ Fileurl " ); Exit (); } Else { If ( $ D = 0 ){ Header ("Location :". $ Fileurl );} Else { $ Fileurl = Str_replace (Array (Pc_base: load_config ('system', 'upload _ url '),'/'), Array (Pc_base: load_config ('system', 'upload _ path'), directory_separator ), $ Fileurl ); $ Filename = Basename ( $ Fileurl );
You can solve this problem.