Jump to content

Warning: date() expects parameter 2 to be long, string given in...


godrob

Recommended Posts

You would only get that error message if the string stored in $_expires is not a long. Since in the OP's code they are setting $_expires = i['expires_date'] and according to the OP the value in the database is '1264164328', the code I posted should work perfectly.

I would interested in knowing if casting that value as an INT solves the problem, because php has had a significant number of basic and reoccurring bugs (the php change log reads like the clown act in a circus.)

 

The last suggested logic is equivalent to the original logic and it should work without error IF the data is what is being reported. I suspect that this is either something to do with register_globals (they are apparently on) or due to the page being requested more than once and when it is requested a second time $pro_id contains something (or nothing) that returns a result set that contains a value for $i['expires_date'] (which is not empty and is not a Unix Timestamp) that does produce the error message being reported.

 

Edit: and in fact, since the code at the start of the page is setting setcookie("pro_id", "", 0, "/"); there is a high likelihood that the page is being requested a second time with pro_id being an empty string and the inconsistent results being reported are due to a mix of information from two sequential requests for the same page.

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.