这里是我的脚本样本WkHtmlToPdf传递变量()
$clientid = $_POST['clientid'];
$from_day = $_POST['stat_from_day'];
$from_month = $_POST['stat_from_month'];
$from_year = $_POST['stat_from_year'];
$to_day = $_POST['stat_to_day'];
$to_month = $_POST['stat_to_month'];
$to_year = $_POST['stat_to_year'];
$from_date_string = $from_day . ' ' . $from_month . ' ' . $from_year ;
$to_date_string = $to_day . ' ' . $to_month . ' ' . $to_year ;
$baseurl = "http://www.test.com/";
$part1 = "?Search=" . $clientid . " from_day=" . $from_day . " from_month=" . $from_month . " from_year=" . $from_year ;
$part2 = " to_day=" . $to_day . " to_month=" . $to_month . " to_year=" . $to_year ;
$time = mktime();
$formatted_time = date("d_M_Y", $time);
$command = "xvfb-run -a /usr/bin/wkhtmltopdf --ignore-load-errors";
$url = $baseurl . $part1 . $part2 ;
$html = file_get_contents($url);
$output_dir = '/var/www/stats/pdf/';
$output = $clientid . '_Search_Export_' . $formatted_time . rand(10000, 99999) . '.pdf';
$generate = shell_exec($command . ' ' . $url . ' ' . $output_dir . $output) ;
这个问题我似乎有与$命令,基本上当它运行wkHTMLtoPDF它通过命令行运行它,和&变量=位通过命令行导致脚本错误&是另一个命令,我的问题是我如何获得正确传递的变量,以便这个脚本然后发送到,将能够使用$ _GET变量我需要脚本才能工作?
我已经做了一些查找,并找到了沿线使用$ argv 1;
但是我似乎无法找到一个接近我的需求的参考。
它可以帮助到OP解释为什么一些不工作,以及如何建议在命令传递尽可能多的后参数修复这种行为。 – dc5