WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Manual.php is a simple PHP script that displays man pages. It is useful for sites that only have FTP access and not Telnet. It is based upon the "man" command and is intended for use on UNIX servers.
Categories : PHP, Complete Programs Click here to Update Your Picture
Marcus Xenakis
Date : May 02nd 1999
Grade : 1 of 5 (graded 1 times)
Viewed : 8547
File : manual.php3
Images : No Images for this code example.
Search : More code by Marcus Xenakis
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

#! /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 &lt;FORM ACTION ... &gt; 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 &gt; 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("","&lt;b&gt;",$lines[$i]); 
   $lines[$i] = str_replace("","&lt;/b&gt;",$lines[$i]); 

------------------------------------------------------------------
This makes the BOLD text bold and does not repeat 
chars....
// Mathias

(not the best way probobly but it works... =)