plazman65 Posted July 26, 2014 Share Posted July 26, 2014 I have this mod installed http://addons.oscommerce.com/info/8080. It works perfect on my local server and downloads correctly . When I transferred everything online including the database,this was updating the database from 2.2 to 2.3 It completes the order online no problem but when you go to download the file you get this error Warning: mktime() expects parameter 6 to be long, string given in /home4/tristan1/public_html/download.php on line 31Warning: Cannot modify header information - headers already sent by (output started at /home4/tristan1/public_html/download.php:31) in /home4/tristan1/public_html/download.php on line 122 In comparing databases etc the the only thing I have been able to figure out that the column "last_modified" in the new orders table database doesnt have a value in it. If I add a date manually in the database the error goes away and the product downloads correctly. I double checked the structure and they are both the same. Since the files are synchronized. I think I need to be looking at something in the database but Im not sure what? Thanks for any help :) Quote Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted July 26, 2014 Share Posted July 26, 2014 I think you would be better to spend time working out why the last modified column is not being set when the order is created. Check the field default value and the code that adds the order to the db. HTH G Quote Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
Jack_mcs Posted July 26, 2014 Share Posted July 26, 2014 @@plazman65 It is an incompatibility problem with the versions of php. Look at the code given at that line and it will have the mktime function. After the first comma, add (int) at the beginning of the second parameter. Since that function is used to set the date, it is also most likely the reason for the empty column. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
plazman65 Posted July 26, 2014 Author Share Posted July 26, 2014 @@plazman65 It is an incompatibility problem with the versions of php. Look at the code given at that line and it will have the mktime function. After the first comma, add (int) at the beginning of the second parameter. Since that function is used to set the date, it is also most likely the reason for the empty column. Thanks! Here is the code list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']); $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year); Im unsure where to put the (int) in it? Can you help? Thanks! Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted July 26, 2014 Share Posted July 26, 2014 I'm sorry. I misread the error. It said parameter 6, not 2. The code should be changed to $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], (int)$dt_year); plazman65 1 Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
plazman65 Posted July 26, 2014 Author Share Posted July 26, 2014 I'm sorry. I misread the error. It said parameter 6, not 2. The code should be changed to $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], (int)$dt_year); Thank you it works like a charm! (w00t) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.