Go to Post What should the lesson of FIRST be? Work within your resources to build the most effective machine that you can--and, at the same time, work to increase those resources. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 10-06-2004, 18:32
Joshua May's Avatar
Joshua May Joshua May is offline
Go Bears!
FRC #1110 (Binary Bulldogs)
Team Role: College Student
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Berkeley, CA
Posts: 1,306
Joshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond repute
Send a message via AIM to Joshua May
PHP Question

I am currently working on a news posting script for my team's site using PHP. I've got everything down for posting and adding news, but I need a way to have only the most recent posts added. I tried to create a while loop so that only the 5 most recent posts show on the index page, but it didn't work. If anyone can help me figure it out, help would be greatly appreciated. And i simplified the part of the code that displays the post.

PHP Code:
<?
$data 
file('news.txt');
$data array_reverse($data);
foreach(
$data as $element) {
    
$element trim($element);
    
$pieces explode("|"$element);
    echo 
$pieces[0] . $pieces[1] . "\n";
    echo 
"<hr>\n";
}
?>
__________________
The FIRST Wiki - openFIRST - Ultimate Robot Challenge - URC Wiki
I currently have 50 GMail invites, PM or email me for one.
UC Berkeley Class of 2009

2005 Las Vegas Regional Autodesk Visualization Award
2005 Las Vegas Regional #8 Seeded Alliance with 988 and 1505
2006 Southern California Regional #15 seed
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Question Raven_Writer Website Design/Showcase 2 22-05-2004 18:42
Question of the Week [05-02-04]: The Very Merry Month of May EddieMcD Rumor Mill 10 05-05-2004 14:02
A question about control system options computhief263 Control System 7 04-02-2004 14:46
What's better, PERL/cgi or PHP/my_sql? mikefrei Programming 10 27-05-2002 22:50


All times are GMT -5. The time now is 15:24.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi