Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Directory Submission Service   I Sell Pagerank   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 02-27-2007, 07:10 PM   #1 (permalink)
Inactive
 
Join Date: 11-07-06
Location: Springfield
Posts: 111
iTrader: 0 / 0%
daniel0012 is on the right pathdaniel0012 is on the right path
Send a message via AIM to daniel0012 Send a message via MSN to daniel0012 Send a message via Yahoo to daniel0012
Events List in PHP

I found a code in PHP that opens a folder on the server that has .txt files with information on different events. Each event is in a different file. I want to have the same function but only display the next event coming up.

Code:
<?php $date = date("Ymd"); $handle=opendir('events'); while (($file = readdir($handle))!==false) { if ($file >= $date) { include("events/$file"); } } closedir($handle); ?>
daniel0012 is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 02-28-2007, 07:21 AM   #2 (permalink)
Inactive
 
Join Date: 02-15-07
Posts: 85
iTrader: 0 / 0%
Latest Blog:
None

atox is on the right pathatox is on the right path
Voila

Try this code, not 100% sure that it works (untested) but should be pretty close.

Code:
<?php $date = date("Ymd"); $handle=opendir('events'); $done = false; while (($file = readdir($handle))!==false && $done == false ) { if ($file >= $date) { include("events/$file"); $done = true; } } closedir($handle); ?>
atox is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-28-2007, 09:25 AM   #3 (permalink)
Inactive
 
Join Date: 11-07-06
Location: Springfield
Posts: 111
iTrader: 0 / 0%
daniel0012 is on the right pathdaniel0012 is on the right path
Send a message via AIM to daniel0012 Send a message via MSN to daniel0012 Send a message via Yahoo to daniel0012
It kinda works. But it rearranges the page.

http://www.scabaptist.org/test/index.php
daniel0012 is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-28-2007, 09:36 AM   #4 (permalink)
Inactive
 
Join Date: 02-15-07
Posts: 85
iTrader: 0 / 0%
Latest Blog:
None

atox is on the right pathatox is on the right path
There are some problems with your table structure.
Some table cells aren't closed properly etc, that's what's causing your page to display incorrect.

Check the validator for more info about your errors.
atox is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-28-2007, 09:54 AM   #5 (permalink)
Inactive
 
Join Date: 11-07-06
Location: Springfield
Posts: 111
iTrader: 0 / 0%
daniel0012 is on the right pathdaniel0012 is on the right path
Send a message via AIM to daniel0012 Send a message via MSN to daniel0012 Send a message via Yahoo to daniel0012
Thanks.
daniel0012 is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Series of unfortunate events... mariuskl Forum Lobby 0 12-19-2007 12:03 AM
Traditional list building V Viral list building trafficmaster Marketing Forum 3 07-18-2007 09:51 PM
SEO Useful List phkharat SEO Forum 3 02-07-2007 04:41 AM
PHP Based Events Calendar? amyintexas Coding Forum 1 11-28-2006 08:49 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 05:09 AM.
© Copyright 2008 V7 Inc