cags Posted December 29, 2009 Share Posted December 29, 2009 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. Link to comment https://forums.phpfreaks.com/topic/185692-warning-date-expects-parameter-2-to-be-long-string-given-in/page/2/#findComment-985519 Share on other sites More sharing options...
PFMaBiSmAd Posted December 29, 2009 Share Posted December 29, 2009 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. Link to comment https://forums.phpfreaks.com/topic/185692-warning-date-expects-parameter-2-to-be-long-string-given-in/page/2/#findComment-985524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.