shyami Posted August 29, 2006 Share Posted August 29, 2006 Hi everyone,i am trying this one, for one weeki am uploading some files through my php code,i need to scan the files for virus information,some sites they referred clamav, so i installed that oneit is working well in command line, in code, i gave like this<?php$e= "testphp.php";echo "<br>";$g= exec("clamscan \"$e\"");echo "Res is <br>";echo $g;?>my output isRes isTime: 1.732 sec (0 m 1 s)from this i can't know anything......How can i get the virus information?guide me! plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzwith thanksshyami Link to comment https://forums.phpfreaks.com/topic/19006-can-you-met-this-problem/ Share on other sites More sharing options...
obsidian Posted August 29, 2006 Share Posted August 29, 2006 take a look at the php manual. exec() only returns the [b]last row[/b] of the result from your external program. there are variables you can pass to retrieve the entire value of the output, but you may want to look at running passthru() instead.[code]<?php$res = array();$e = "test.php";exec("clamscan \"$e\"", $res);echo "Res is:<br />\n";echo "<pre>\n";foreach ($res as $row) echo "$row<br />\n";echo "</pre>\n";?>[/code]try that out instead, and you should have the entire result printed out in preformat tags.good luck Link to comment https://forums.phpfreaks.com/topic/19006-can-you-met-this-problem/#findComment-82153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.