看板 PHP 關於我們 聯絡資訊
※ 引述《s31039 (Brice)》之銘言: : : $temp=passthru("sudo /sbin/iptables -t nat -L -n"); : : 結果a.txt檔內卻沒有出現任何文字 : : 而且passthru若改為exec函數就有文字出現 不過只有最後一列而已 void passthru ( string command [, int &return_var] ) void 的意思是... 不會有東西了 所以你 $temp = passthru... 怎麼可能有東西呢!? 在說 : http://tw.php.net/passthru The passthru() function is similar to the exec() function in that it executes a command. This function should be used in place of exec() or system() when the output from the Unix command is binary data which needs to be passed directly back to the browser. =.= 所以請改用 exec() or system() : : 或是還有其他方法比較容易呢? : : thanks : 改成 passthru("sudo /sbin/iptables -t nat -L -n",$temp); : 結果也是一樣 -- 你可以攀爬聖母峰一千次,不過他永遠也不會知道你的名字, 認清自己的無名與恐怖的後果,是登山者謙卑的秘訣、攀岩者應有的自覺 David Breashea -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 221.169.25.33