Hi I am new to PHP and hope someone can help me.
Sometimes the output from the executed shell script can be hundreds of lines long, the lines are separated with a <BR> (replaced \n in shell script) for formatted html output.
So I need to know how to make the output paginated, I looked at some other similar solutions here but I couldn’t make them work as they did different things.
$url = $_POST["website"];
$safeurl = escapeshellarg($url);
#passthru("./check -n ".$safeurl);
$stuff=shell_exec("./webcheck -n ".$safeurl);
$webFile = ($url.'.txt');
$write = $stuff;
$fh = fopen($webFile, 'w') or die("can't open file");
fwrite($fh, $write);
fclose($fh);
$fh = fopen($webFile, "r") or die("can't open file");
$frstuff=fread($fh, filesize($webFile));
fclose($fh);
echo $frstuff;
Its not the best solution, but the easiest is going to be using javascript to do the pagination.
Try: http://plugins.jquery.com/project/pagination
Otherwise you could plugin a generic database pagination script and change the database adaptor to point to a file adaptor, where number of rows becomes number of lines.
Edit: provided better link