#! /usr/bin/php
<HTML>
<HEAD>
<TITLE>Unix Manual</TITLE>
</HEAD>
<BODY>
<b><font face=arial size=+1>Unix Manual</font></b>
<?php
/*
by Marcus S. xenakis 5/2/99
marcus@xenakis.net
This script calls the UNIX man command.
It is usefull for sites that have access to FTP
but not Telnet. This script makes it easier to
read man pages even on those sites with Telnet.
Many man entries are lengthy and require you to
use more or pg filters, and you can't page back.
It was developed and tested at communitech.net that
runs SunOS, please note the code that removes the
headings you may have delete or modify those lines.
It also removes blank lines. There is no error
trap so missing man pages are retunred blank.
*/
echo "<font face=arial><br>";
print(date("m/d/y h:i"));
echo "<sp>CST<br>";
// --- add promter and recursive call
echo "<form action=\"manual.php\">";
echo "Command: ";
echo "<input type=\"text\" size=30 name=\"parm\"> ";
echo "<input value=\" Submit \" type=submit>";
echo "<hr><br>";
echo "</font><pre>";
$blank = 0;
$prior = 0;
$semi = strpos($parm,";");
if ($semi > 1) {
$parm = substr($parm,0,$semi);
}
exec("man $parm",$lines,$rc);
$count = count($lines);
for ($i = 1; $i <= $count; $i++) {
// DELETE ATTRIBUTE CHARACTERS
$lines[$i] = str_replace(chr(8),"",$lines[$i]);
$lines[$i] = str_replace("_","",$lines[$i]);
// reset print flags
$print = 1;
if (strlen($lines[$i]) > 1) {
$blank = 0;
$prior = 0;
} else {
$blank = 1;
}
// SURPRESS A HEADER LINE - MODIFY FOR YOUR SIT
if (substr($lines[$i],0,6) == "SunOS ") {
$print = 0;
$prior = 1;
}
// SURPRESS A HEADER LINE - MODIFY FOR YOUR SITE
if (substr($lines[$i],0,13) == "User Commands") {
$print = 0;
$prior = 1;
}
// SURPRESS MULTIPLE BLANK LINES
if ($blank == 1 and $prior == 1) {
$print = 0;
}
if ($print == 1) {
echo "$lines[$i]<br>";
}
// SET FLAG -BLANK LINE PRINTED
if ($blank == 1) {
$prior = 1;
}
}
echo "</pre>";
?>
<hr>
<br>
</body>
</html>
Functions to access a NNTP/NNRP newsserver. Complete set with examples is at ftp://ftp.nederland.net/pub/nnrplib Categories : Search , PHP , Complete Programs PHP port of Matt Wrights FormMail.pl WWW form to e-mail gateway. Categories : Email , Complete Programs , Environment Variables , PHP DDN FFA Network Script Categories : PHP , MySQL , Complete Programs , HTML and PHP , Databases This is a script that list all image files on a given directory, and displays
the thumbnails nicely formated within an HTML table. It also make use of
JavScript to open pop up windows when the users want to see the full photo. Categories : Graphics , PHP , Complete Programs , Java Script Web Self Service Resource Scheduler Using Session Variables under php4 includes Calendar building code - requires MySQL Categories : PHP , Complete Programs , Calendar , MySQL , Databases A set of functions sitting on top of the abstraction layer that makes it a little easier to do SQL stuff. Documentation is within Categories : Databases , ODBC , Complete Programs , PHP PHPLinkRot v1.0 - program which allows users to report broken links on
your website just by clicking a button. Works well on custom 404 pages Categories : PHP , Complete Programs , Debugging , URLs , Site Planning A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed. Categories : Date Time , PHP , Complete Programs , Calendar A simple bubblesort that takes 2 arrays as argument.The first one is the actual data used for sorting, the second is data that will "tag along" with the first array, for instance a descriptive text about the data in the first array. Categories : Algorithms , Arrays , PHP , Complete Programs This is a simple photo gallery that reads the image files from multiple directories, and generates a web page styled with CSS1. It opens single auto window to view and print a given image.
Categories : Graphics , Filesystem , PHP , Complete Programs Searches through a local INN server's discussions Categories : Search , Complete Programs , PHP This is a redirection program which is as good as the come.to v3 url
redirection, complete with admin interface all clients stored in mysql
Categories : PHP , MySQL , Ecommerce , HTML and PHP , Complete Programs Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP , PHP , HTML , PDF , Excel An email validation script that actually checks against the recipient's mail server. Categories : Email , Complete Programs , PHP , Network , Debugging DirtSearch Version 3.5 full function robust PHP and MySQL (and other
databases) Site or Web Wide Search Engine
Categories : PHP , MySQL , Complete Programs , Search , Databases
strange eh! wrote : 246
Where`s the manual?
Marcus Xenakis wrote : 247
Reply to the above comment:
The man, or manual pages must be installed on the
UNIX server. They are optional although most systems
have them installed for basic commands. The script only
provides access and reformatting via HTTP.
Kelvin Lee wrote : 335
I think replace the "manual.php3" to "$PHP_SELF" in
the <FORM ACTION ... > tag will be better.
Mathias Eriksson wrote : 418
I changed the DETELE ATTR.... part to this
------------------------------------------------------------------
// DELETE ATTRIBUTE CHARACTERS
$ake = strpos ($lines[$i], chr(8));
while ($ake > 0) {
$lines[$i][$ake - 1] = "";
$lines[$i][$ake] = $lines[$i][$ake + 1];
$lines[$i][$ake + 1] = "";
$ake = strpos ($lines[$i], chr(8));
}
$lines[$i] = str_replace("","<b>",$lines[$i]);
$lines[$i] = str_replace("","</b>",$lines[$i]);
------------------------------------------------------------------
This makes the BOLD text bold and does not repeat
chars....
// Mathias
(not the best way probobly but it works... =)