1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Expired items code

Discussion in 'PHP' started by NITRO23456, Aug 27, 2009.

  1. #1
    I am trying to redirect users if they try to edit a record that has expired according to the date entered in the DATE field.

    It works great, but the <now() includes today as well as all other historic dates and thus is redirecting if DATE = today..... such records havent technically expired. Any ideas what to replace the <now() with?

    
    $strSQL = "select `DATE` from TABLE where ID=".$_REQUEST["editid1"];
    $rs = db_query($strSQL,$conn);
    $data = db_fetch_array($rs);
    if ($data["DATE"]<now())
    {
    header("Location: other.php");
    }
    else
    {
    
    }
    
    Code (markup):

    SEMrush
     
    NITRO23456, Aug 27, 2009 IP
    SEMrush
  2. kane4545

    kane4545 Guest

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why dont you get the date converted in required format first using php and then pass it into the mysql query so that you can get the proper result
     
    kane4545, Aug 27, 2009 IP