----- Original Message ----- 
From: "fremaje31" 

Hello All,

I need you all again.  I have a event page that search by date but I 
want visitors/users to be able to search by date range.  I've searched 
Google for this but I must be wording it wrong because I'm not getting 
the solution.

Here's the page I'm referring to - 
http://mybusinesscircle.startlogic.com/events.php

I also need a code to drop events once the date has passed.

Thanks,

Tisha

------------------------------------

It's a bit hard without seeing the code!

An example, not the best way as I don't what code you already have. 

function testdate($string)
  {
  $result = substr($string$, 6, 4);
  $result .= substr($string, 0, 2);
  $result .= substr($string, 3, 2);
  return $result;
  }

function inrange($current, $start, $end)
  {
  $current = testdate($current);
  $start = testdate($start);
  $end = testdate$($end);
  if($cuurent < $start) {return FALSE;}
  if($current > $end} (return FALSE;}
  return TRUE;
  }

$startdate = '01/01/2008';
$enddate = '12/31/2008';

foreach($dataitem as $thisdataitem)
  {
  $thisdate = $thisdataitem['date'];
  if(inrange($thisdate, $startdate, $enddate))
    {
    // echo HTML for this item
    }
  $currentdate = date(//please insert date format string for MM/DD/YYYY);
  if(testdate($thisdate) < testdate($currentdate))
    {
    // delete this data item
    }
  }

Rob.

Reply via email to