Jump to content

Can you met this problem?


shyami

Recommended Posts

Hi everyone,

i am trying this one, for one week

i 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 one
it 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 is

Res is
Time: 1.732 sec (0 m 1 s)


from this i can't know anything......
How can i get the virus information?


guide me! plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz




with thanks
shyami
Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.