Jump to content

[SOLVED] Date/Time Arggghhh


wsantos

Recommended Posts

Argggg...Any troubleshooting tips as for why I'm getting empty screen on this one

 

if(empty($_REQUEST['StartDate']) || empty($_REQUEST['EndDate']) || compare_date($_REQUEST['StartDate'],$_REQUEST['EndDate'])<0)
  {
    $startyear = date("Y");
    $startmonth = date("m");
    $startday = date("j");
    $endyear = date("Y");
    $endmonth = date("m");
    $endday = date("d");
  }
  else
  {
    echo $_REQUEST['StartDate']; // Test
    $pststartdate = $_REQUEST['StartDate'];
    $pstenddate = $_REQUEST['EndDate'];
    list($startmonth, $startday, $startyear) = split('[/.-]', $pststartdate);
    list($endmonth, $endday, $endyear) = split('[/.-]', $pstenddate);
  }
  $starttime = mktime(0,0,0,$startmonth,$startday,$startyear);
  $endtime = mktime(23,59,59,$endmonth,$endday,$endyear)
  echo $starttime;  //Test

 

      <FORM NAME=DATE ACTION="<?php echo $_SERVER['PHP_SELF']; ?>" METHOD=POST>
        <TABLE ALIGN=CENTER>
          <TR>
            <TD>
              Start Date
            </TD>
            <TD>
              <INPUT ID='calStart_container' NAME='StartDate'>
            </TD>
          </TR>
          <TR>
            <TD>
              End Date
            </TD>
            <TD>
              <INPUT ID='calEnd_container' NAME='EndDate'>
            </TD>
          </TR>
          <TR>
            <TD COLSPAN=2 ALIGN=CENTER>
              <INPUT TYPE=SUBMIT VALUE=QUERY>
            </TD>
          </TR>
        </TABLE>
      </FORM>

Link to comment
https://forums.phpfreaks.com/topic/78597-solved-datetime-arggghhh/
Share on other sites

 

  if(empty($_REQUEST['StartDate']) || empty($_REQUEST['EndDate']))
  {
    $startyear = date("Y");
    $startmonth = date("m");
    $startday = date("j");
    $endyear = date("Y");
    $endmonth = date("m");
    $endday = date("d");
    $starttime = mktime(0,0,0,$startmonth,$startday,$startyear);
    $endtime = mktime(23,59,59,$endmonth,$endday,$endyear);
  }
  else
  {
    echo $_REQUEST['StartDate'];
    $pststartdate = $_REQUEST['StartDate'];
    $pstenddate = $_REQUEST['EndDate'];
    list($startmonth, $startday, $startyear) = split('[/.-]', $pststartdate);
    list($endmonth, $endday, $endyear) = split('[/.-]', $pstenddate);
    $starttime = $startyear . "-" . $startmonth . "-" . $startday . " 00:00:00";
    $endtime = $endyear . "-" . $endmonth . "-" . $endday . " 23:59:59";
  }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.