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 : Opening and formatting text files into HTML on the fly- or HTML from templates.
Categories : PHP, HTML and PHP, Filesystem Update Picture
Steven Bogers
Date : Jul 31st 1998
Grade : 1 of 5 (graded 1 times)
Viewed : 16960
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Steven Bogers
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

I looked everywhere for code that would take multiple text files and do a
simple conversion 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 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:

-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.
-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.
-It can read from any mounted drive: works with Novell, Samba, NFS, Apple..

text file format (I used):
DEPARTMENT
(space)
TITLE
(space)
NEWS (multiple lines are fine)



-----code-------
<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>
----code---



Progression bar for PHP http multiple file uploads, using Infomentum's AppletFile
Categories : PHP, HTML and PHP, Filesystem
Directory viewer, customize how you display the file structure, easy to understand. Found out about PHP 3 days ago, and this is my first prog.
Categories : HTML and PHP, Complete Programs, Directories, Filesystem, PHP
Handle multiple file upload
Categories : Complete Programs, Filesystem, PHP, HTML and PHP
A simple php file uploader
Categories : PHP, Filesystem, HTML and PHP
Open directory and File download
Categories : PHP, Filesystem, Directories, HTML and PHP
How to let a user download a picture by clicking on it instead of needing to right click and Save-As.
Categories : HTTP, PHP, HTML and PHP, Filesystem
PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use!
Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP
Directory TreeView - File Manager & Explorer - FTP - Utility - PHP/HTML -
Categories : PHP, Directories, FTP, Filesystem, HTML and PHP
Random Image Display
Categories : PHP, Filesystem, Graphics, HTML and PHP
A script to generate a report from a valid mysql connection. The user has to supply which fields he wants to display in table. All properties are changable.
Categories : PHP, PHP Classes, Databases, MySQL, HTML and PHP
Simple PHP control CSS Calendar
Categories : PHP, HTML and PHP, Calendar, Date Time, CSS
Automatically printing the contents of an sql table in MySQL.
Categories : MySQL, PHP, HTML and PHP, Databases
These 2 functions write and read the contents of a specially designated multi-dimensional array to and from a text file.
Categories : Algorithms, PHP, Filesystem
PHP template processing
Categories : PHP, Templates, HTML and PHP
Local-to-user date and time display regardless of time zone or where the website's server is located
Categories : PHP, Date Time, HTML and PHP, Java Script
 Dan Silk wrote :243
That`s a great idea!  How would you do that on an NT 
server?