PHP Classes

File: TestSlashHeadlines.php

Recommend this page to a friend!
  Classes of Sandip Bhattacharya   SlashHeadlines   TestSlashHeadlines.php   Download  
File: TestSlashHeadlines.php
Role: ???
Content type: text/plain
Description: Test file for seeing how the class works. Put this along with the class file on a webserver, (after reading README), and see if it works!
Class: SlashHeadlines
Author: By
Last change:
Date: 21 years ago
Size: 1,386 bytes


Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- $Id: TestSlashHeadlines.php,v 1.1 2001/03/09 23:14:06 sandipb Exp $ --> <html> <head> <title> Welcome</title> </head> <body bgcolor="white"> <p align="center"> <font face="helvetica" color="maroon"> <h1><i> SlashDot Headlines </i></h1> </font> </p> <?php include "SlashHeadlines.php"; $sh = new SlashHeadlines(); $status= $sh->update(); if ($status){ $n= $sh->get_num_stories(); print "<p><TABLE align=\"center\" border=\"1\" bordercolor=\"black\">"; for ($i=0;$i<$n;$i++){ print "<TR>"; print "<TH bgcolor=\"#f0f0f0\">".$sh->stories[$i]->section.": <A href=\"".$sh->stories[$i]->url."\">".$sh->stories[$i]->title."</A></TH>"; print "</TR>"; print "<TR><TD>"; print "<IMG align=\"right\" src=\"".$sh->stories[$i]->image."\" >"; print "Posted by <B>".$sh->stories[$i]->author."</B> on <I>".$sh->stories[$i]->time."</I></BR>"; print "From the <B>".$sh->stories[$i]->department."</B> department</BR>"; print $sh->stories[$i]->comments." comments till now."; print "</TD></TR>"; } print "</TABLE></p>"; print "<p align='center'><small><I>Last updated: ".$sh->get_last_update()."</I></small></p>"; } else { print "An error occured while fetching the SlashHeadlines."; } ?> </p> </body> </html>