php - Non-English Windows directory name in url link -
i have php file searches computer's windows directory. if have directory contains non-english character "Önder Şoğlopıpk" returns null. php file so:
$port = $_get["port"];//here computer's port $path = trim($_get["path"]);//here path not work $path = str_replace(" ","+",$path); $path = urlencode($path); $suffix = $_get["suffix"];//here suffix searching if($_get){ $url='http://mylink.com?host=localhost&port='.$port.'&showerrorinxml=yes&link=proc_list?find_files___path='.$path.'___suffix='.$suffix.''; $ch = curl_init(); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_url, $url); $data = curl_exec($ch); curl_close($ch); $xml = simplexml_load_string($data); if there non-english character in path variable "Ş Ğ ı ş ğ i" returns null me. if english there no problem. can search want. urlencoding did not work. url seems directory named "seçpa yazılım login" is:
http://mylink.com?host=localhost&port=44833&showerrorinxml=yes&link=proc_list?find_files___path=d%3a%2fse%c3%a7pa%2byaz%c4%b1l%c4%b1m%2blogin%2f___suffix=.css and seems on browser that:
http://mylink.com?host=localhost&port=44833&showerrorinxml=yes&link=proc_list?find_files___path=d%3a%2fseçpa%2byazılım%2blogin%2f___suffix=.css anyone has idea topic?
you need urldecode input after retrieving it:
$path = trim( urldecode( $_get['path'] ) ); update: ok, read question more carefully. me seems if encoding url twice. first time implicit sending browser through http request , second time @ $path = urlencode( $path );
Comments
Post a Comment