423,103 Members | 1,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,103 IT Pros & Developers. It's quick & easy.

mktime() expects parameter 6 to be long, string given in

100+
P: 250
I want to expire user account in my php application. Below is my code . But i got "mktime() expects parameter 6 to be long, string given in ". Could anyone tell me what is wrong? Please..

Expand|Select|Wrap|Line Numbers
  1.  list($year, $month, $day) = split('[/.-]', $Valid_From);
  2.                         $daystoadd="$Validity_Period";
  3.                         $hours=$daystoadd * 24;
  4.                         $newdate=date("Y-m-d", mktime($hours, 0, 0, $month, $day, $year));
  5.                         $today = date("Y-m-d");
  6.                         if($newdate>$today)
  7.                         {
  8.  
  9.                         }
  10.                         else
  11.                         {
  12. You Are Logged in As Guest 
  13.  
Jul 11 '08 #1
Share this Question
Share on Google+
3 Replies


pbmods
Expert 5K+
P: 5,821
Heya, Ghjk.

Cast your values as ints:
Expand|Select|Wrap|Line Numbers
  1. mktime( ..., (int) $year );
  2.  
Jul 11 '08 #2

P: 1
Hey pbmods;

Ur a genius man... I assure everyone tat this works 100%..
great work dude..
Jun 10 '10 #3

P: 1
where include it in codigniter code...

mktime( ..., (int) $year );
Jun 13 '18 #4

Post your reply

Sign in to post your reply or Sign up for a free account.