Jump to content

PHP Validation Problem


vinoindiamca

Recommended Posts

Hi ,

    I Need help

if given date is between $firstDate1 and $firstDate2 then

do

$payment=$offroomamt * $days;

else

if given date is not in $firstDate1 and $firstDate2 then

echo"Invalid date";

 

For this i need code for "not greater than" and "not lessthan" symbol to proceed validation i used following code but it gives error please give the solution to check not greater than also

 

 

 

if($typroom=='1' && $sestime=='1')

{

  if( $arrivaldt >= $firstDate1 && $arrivaldt <= $firstDate2  )

  {

      $payment=$offroomamt * $days;

   

  }

  if( $arrivaldt >= $secondDate1 && $arrivaldt <= $secondDate2 )

  {

      $payment=$sesroomamt * $days; 

     

  }

//i need help in below code

  if( $arrivaldt !>= $firstDate1 && $arrivaldt !<= $firstDate2  )

  {

        echo"Invalid date";

  }

  if( $arrivaldt !>= $secondDate1 && $arrivaldt !<= $secondDate2 )

  {

    echo"Invalid date";

  }

 

 

 

 

}

Link to comment
https://forums.phpfreaks.com/topic/138466-php-validation-problem/
Share on other sites

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.