You are here: Re: exec() incomplete $output « PHP Programming Language « IT news, forums, messages
Re: exec() incomplete $output

Posted by ajh on 12/27/06 12:14

Thanks for your suggestions Erwin. I've turned on all the error
messages and done some minor debugging. Nothing that related to the
output though. The underlying program is a basic search engine - you
are right about the html output so I made that htmlentities change but
it didn't make a difference.

Here is the code:


<?php

define("PROG", "/blah/bling/query");

$crawl = "courses";

$indexfile = "$crawl.csv";
$crawldir = "$crawl";
$namesfile = "$crawl.names";
$rankfile = "$crawl.rank";
$maxhits = 10;
$querystr = escapeshellarg($_GET['query']);

// Check if querystr is present
if ($querystr!=NULL)
{
// Run the query
unset($out);
exec("echo " . $querystr . " | " . PROG . " -i $indexfile -d
$crawldir -n $namesfile -p $rankfile -m $maxhits", $out);
}

?>

<html>
<body bgcolor="#ffffff">

<br>
<br>
<form method="get" action="<?php print $_SERVER['PHP_SELF']?>">
<input name="query" type="text" size="50" maxlength="50">
<input type="button" value="submit" />
</form>

<br>
<br>

<?php
// show output
foreach ($out as $val)
{
echo htmlentities($val)."<br/>";
}
?>

</body>
</html>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация