我有我將使用這個PHP代碼在Linux上運行解析錯誤:語法錯誤,意外'(T_CONSTANT_ENCAPSED_STRING)
<?php
include 'theme.php';
ceklogin();
css();
if($_POST['wget-send'])
{
$dir=$_POST['dir'];
$link=$_POST['link'];
exec('cd '.$dir,$out);
exec('echo '.$link' > /tmp/wget-download-link.txt',$out);
exec('wget -i /tmp/wget-download-link.txt -o /tmp/wget.log -c -t 100 -w 10',$out);
echo $out[2];
exit();
}
echo "<br><br><form action=\"".$PHP_SELF."\" method=\"post\">";
echo "Download directory :<br><input type=\"text\" name=\"dir\" size=\"15\" value=\"/mnt/usb/\"/><br>";
echo '<br>Download link :<br>';
echo "<textarea name=\"link\" rows=\"4\" cols=\"35\"></textarea><br><br>";
echo '<input type="submit" name="wget-send" value="Send" />';
echo "</form></div>";
foot();
echo '
</div>
</body>
</div>
</html>';
?>
wget的當我嘗試運行它給了我錯誤的PHP:
Parse error: syntax error, unexpected '' > /tmp/wget-download-link.tx' (T_CONSTANT_ENCAPSED_STRING) in /www/wget.php on line 10
我哪裏出錯了?
' '$ link'' - >''。$ link.'' – kero