Hey am getting an error like this Warning: mktime() expects parameter 6 to be long, string given in /home/bizdirec/public_html/includes/functions.php on line 320 So what could be wrong ? View attachment 1.txt $date_day = date ( "d" ); $date_month = date ( "m" ); $date_year = date ( "Y" ); list ( $on_year, $on_month, $on_day ) = split ( '[/.-]', $date ); $first_date = mktime ( 0,0,0,$on_month,$on_day,$on_year ); $second_date = mktime ( 0,0,0,$date_month,$date_day,$date_year ); if ( $second_date > $first_date ) Plz help me to resolve the problem.
The clue is in the error message; but its a bit of a red herring. If you know the data is just the wrong type, you can just cast it like so; $first_date = mktime ( 0,0,0,$on_month, $on_day, (int) $on_year ); PHP: However, taking a look at your code list ( $on_year, $on_month, $on_day ) = split ( '[/.-]', $date ); PHP: It would appear $date is empty/not defined so the list of variables will contain nothing. (casting it as an int would still work, but it would be forced to zero).
Thanks Mr lukeg32 The error message is not showing now. But still i have one doubt. Classified listings are supposed to expire after the defined period. Will it work ?
Yah - if the current time is more than the time you are processing, looks like it will work fine. It might be just as simple - if its stored in mysql database - to let the database sort it; SELECT rowid FROM your_table WHERE now() > your_date_field; [... process expired classifieds ...] Code (markup):