If I pass string content then it works fine and on submit it shows me result. But when I pass the content of webpage received using escapeshellarg(strip_tags($text));. It shows nothing on the screen.

<?php
//sent has value "http://www.paulgraham.com/herd.html"
$url=$_POST['sent'];
$text = file_get_contents($url);
$temp=escapeshellarg(strip_tags($text));
//$temp="one two two"; If I pass $temp with string content it gives result
echo $temp;  //Echo $temp shows content of webpage 
$output=shell_exec("/home/technoworld/Videos/LinSocket/Modular/x '$temp'");
echo $output;
?>
有帮助吗?

解决方案

Thanks for comming here:

I got the answer:

<?php
//sent has value "http://www.paulgraham.com/herd.html"
$url=$_POST['sent'];
$text = file_get_contents($url);
$temp=escapeshellarg(strip_tags($text));
$output=shell_exec("/home/technoworld/Videos/LinSocket/Modular/x " . $temp);
echo $output;
?>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top