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
PHP Web Logs (BLogs)
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
Forex Trading Online forex trading platform

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 : Dtheatre.com Headline Grabber: Snags headline from dtheatre.com and can be used for many other news site
Categories : Complete Programs, Algorithms, HTML and PHP, HTTP Update Picture
Joe Lumbroso.com
Date : Mar 23rd 2000
Grade : 3 of 5 (graded 1 times)
Viewed : 4827
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Joe Lumbroso.com
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?php

// for more info visit:
// http://www.dtheatre.com/dthg.php3

$link_prefix = "&nbsp;&nbsp;o ";
$link_postfix = "<BR>\n";
$cache_file = "/tmp/dtheatre.com.cache";
$cache_time = 3600;
$max_items = 10;
$target = "_top";

// End of customizations

$backend = "http://www.dtheatre.com/backend.php3?xml=yes";

$items = 0;
$time = split(" ", microtime());

srand((double)microtime()*1000000);
$cache_time_rnd = 300 - rand(0, 600);

if ( (!(file_exists($cache_file))) || ((filectime($cache_file) + $cache_time - $time[1]) + $cache_time_rnd < 0) || (!(filesize($cache_file))) ) {

$fpread = fopen($backend, 'r');
if(!$fpread) {
// echo "$errstr ($errno)<br>\n";
// exit;
} else {

$fpwrite = fopen($cache_file, 'w');
if(!$fpwrite) {
// echo "$errstr ($errno)<br>\n";
// exit;
} else {

while(! feof($fpread) ) {

$buffer = ltrim(Chop(fgets($fpread, 256)));

if (($buffer == "<item>") && ($items < $max_items)) {
$title = ltrim(Chop(fgets($fpread, 256)));
$url = ltrim(Chop(fgets($fpread, 256)));

$title = ereg_replace( "<title>", "", $title );
$title = ereg_replace( "</title>", "", $title );
$url = ereg_replace( "<url>", "", $url );
$url = ereg_replace( "</url>", "", $url );

fputs($fpwrite, "$link_prefix<A HREF=\"$url\" TARGET=\"$target\">$title</A>$link_postfix");

$items++;
}


}
}
fclose($fpread);
}
fclose($fpwrite);
}
if (file_exists($cache_file)) {
include($cache_file);
}
?>



AITSH Errorbot
Categories : Complete Programs, HTML and PHP, HTTP
phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install.
Categories : PHP, Complete Programs, HTML and PHP, MySQL
Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET
Categories : Algorithms, HTML and PHP, PHP, Variables
Sed, a coder's best friend. This lovely linux command allows you to swap strings in a file. Great for changing a variable name in a script with multiple files.
Categories : HTML and PHP, HTML and PHP
A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL
PHP4 HTTP Compression Speeds up the Web
Categories : PHP, Zlib, HTML and PHP, HTTP, Network
PHP mySQL learning example This is a complete program to modify tables in a mySQL database on a nice and neat way.
Categories : PHP, MySQL, Complete Programs, HTML and PHP
Browse a MySQL database & draw a tree view & load final items into a template page.
Categories : MySQL, Complete Programs, Algorithms, PHP, Databases
AITSH Guestbook
Categories : Complete Programs, HTML and PHP, Databases, MySQL
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
AITSH Statistics
Categories : Complete Programs, Databases, HTML and PHP, Sessions, 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
This script shows you the 7th latest php items from the mailing list archive on zend.com
Categories : HTML, HTML and PHP, HTTP, PHP
Pseudo Non Parsed Header. Output to the the browser as the script runs.
Categories : PHP, HTTP, HTML and PHP
Paginating the mySQL data
Categories : PHP, Algorithms, Databases, MySQL, HTML and PHP