WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
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 Index
Web Development Resources
Web Development Content
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
Mobile Dev World

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 : Take multiple text files and do simple formatting on them and add them to a webpage
Categories : HTML, Filesystem, PHP Update Picture
Steven Boger
Date : Jan 17th 1999
Grade : 1 of 5 (graded 1 times)
Viewed : 4218
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Steven Boger
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

I looked everywhere for code that would take multiple text files and do
simple formatting on them and add them to a webpage. I ended up writing
one myself. The premise is simple, I needed a way for the monkeys hitting
the keys to easily add to the company webpage news section. Writing HTML
was DEFINATELY out, so I have them create a simple text file in windows
notepad and save it to a share drive. The code looks at the share drive,
gets the filenames, reads each file and formats the text - All on the fly.

NEATO FEATURES:

1. Totally self-maintaining: Instantly reads new news on the fly and when the
monkeys want it off the news section, they just delete the text file.
2. By using the ls command with -t, it automatically puts the newest news item
first, without a ton of extra code. Also, ls allows you to look at multiple
extensions and directories at the same time.
3. It can read from any mounted drive: works with Novell, Samba, NFS, Apple..

Text file format(I use):

First line is department,
second line blank,
third line is title,
fourth line blank,
fifth line and on is the news...

Steven S. Boger
sboger@hotmail.com
email me if you have questions

<HTML>
<BODY>
<center>
Department News
<br><br><br>
<table width="90%" border="0" cellspacing="0" cellpadding="10">
<?php
exec( "/bin/ls -t /mnt/novell/EVERYONE/news/*.txt /mnt/novell/EVERYONE/news/*.TXT",$s);
for ($p = 0;$p < count($s);$p++) {
echo "<TR bgcolor=\"#D0D0D0\"><TD>\n";
$file = file( "$s[$p]");
for($i = 0;$i < count($file);$i++) {
if ($i == 0) {
echo "<font size=\"+1\">$file[$i]</font><BR>\n";
} elseif ($i == 2) {
echo "<font size=\"+2\">$file[$i]</font></td></tr><TR BGCOLOR=\"#E0E0E0\"><td>\n";
} else {
echo "$file[$i]<BR>\n";
}
}
echo "</td></tr><TR><TD><br></TD></TR>\n";
}
?>
</table></center>
</BODY>
</HTML>



Prints a bar of links to each HTML page it finds in the current directory, using the <TITLE> tag for the name of each link
Categories : HTML, Filesystem, PHP
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Variable serialization and unserialization. Loading and saving variable structures to and from file.
Categories : Arrays, Filesystem, Variables, Strings, PHP
JSON File Upload
Categories : PHP, AJAX, Filesystem
upload function using PHP's FTP abilities.
Categories : PHP, Filesystem, HTML and PHP
Get the correct extension and MIME types of an image, even when the filename is incorrect.
Categories : PHP, Filesystem, General SQL
Directory TreeView - File Manager & Explorer - FTP - Utility - PHP/HTML -
Categories : PHP, Directories, FTP, Filesystem, HTML and PHP
Kasskooye($path) tell you the complete size of a folder
Categories : PHP, Algorithms, Utilities, Filesystem
Email attachment code
Categories : PHP, Email, Filesystem
a file explorer for the web, filesystem php php3 files dirs directories pictures files windows linux system list ls scripts
Categories : PHP, URLs, Directories, Filesystem
Disk Usage, uses UNIX du command.
Categories : Complete Programs, PHP, Filesystem
color codes for positive and negative numbers
Categories : PHP, MySQL, Databases, HTML
Script to check values being submitted by POST or GET method from a form. This script may help diagnose what variables are being supplied by a browser to other php scripts.
Categories : HTML, Variables, Debugging, PHP, HTTP
Show Source with Line Numbers
Categories : PHP, Regexps, Filesystem
include php3 files
Categories : Filesystem, PHP, Apache, Web Servers