Wednesday, April 28, 2010

How to add days, weeks, months to any date ?

$date = date("Y-m-d");// current date

$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 day");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 week");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +2 week");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 month");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +30 days");
echo date("Y-m-d", $date);//Now your can see added date

Friday, February 12, 2010

how can login in ilias with own page

Suppose my site ishttp://www.xyz.com/">www.xyz.com/ilias is installied onhttp://www.xyz.com/lms">www.xyz.com/lmsthen you can create your on login page like this
Login to ILIAS
User Name
Password
//you can also use in another way
http://www.blogger.com/go1.gif" name="butSubmit">
/////////////////////This concept is used on gradtrain.com////////////////

File upload like gmail

Step1: Create A file name index.php
File Uploading Like Gmail. You can upload multiple files without submitting the whole page. You can upload file like ajax. This is using iframe for file upload




Step2:create a file upload.php

Tuesday, January 12, 2010

Check Date Between Two Dates in PHP


function dateBetween( $checkDate )
{
$firstDate1 = strtotime( "15-Jan-2008" );
$firstDate2 = strtotime( "15-Mar-2008" );
$secondDate1 = strtotime( "16-Mar-2008" );
$secondDate2 = strtotime( "15-Jun-2008" );

$checkDate = strtotime( $checkDate );

if( $checkDate > $firstDate1 && $checkDate < $firstDate2 )
{
return "2000";
}
elseif( $checkDate > $secondDate1 && $checkDate < $secondDate2 )
{
return "4000";
}

return "0";
}

echo dateBetween( "25-Sep-2008" );

?>