Php 分析错误:语法错误,意外“”(T\u常量\u封装的\u字符串)
我有这个php代码,我将使用它在linux上运行wgetPhp 分析错误:语法错误,意外“”(T\u常量\u封装的\u字符串),php,wget,Php,Wget,我有这个php代码,我将使用它在linux上运行wget <?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('wg
<?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>';
?>
我哪里出错了?漏了一个。在这一行:
exec('echo '.$link.' > /tmp/wget-download-link.txt',$out);
exec('echo '.$link.' > /tmp/wget-download-link.txt',$out);
少了一个。在此行中的$link之后:
exec('echo '.$link.' > /tmp/wget-download-link.txt',$out);
exec('echo '.$link.' > /tmp/wget-download-link.txt',$out);
这个网站不是为你的基本语法调试错误,但在这里你无论如何去
exec('echo '.$link' > /tmp/wget-download-link.txt',$out);
你错过了机会。$link之后
应该是
exec('echo '.$link.' > /tmp/wget-download-link.txt',$out);
“.$link”->”.$link。“