Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 分析错误:语法错误,意外“”(T\u常量\u封装的\u字符串)_Php_Wget - Fatal编程技术网

Php 分析错误:语法错误,意外“”(T\u常量\u封装的\u字符串)

Php 分析错误:语法错误,意外“”(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代码,我将使用它在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('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。“