gerkintrigg Posted July 1, 2007 Share Posted July 1, 2007 I'm getting this rather ugly error when i try to use the same include more than once: Fatal error: Cannot redeclare resize_png_image() (previously declared in path/backup+.php:189) in path/backup2.php on line 189 Is there anything I can do to stop it happening? - I need to re-use this include anything up to 50 times on a page. Thanks chaps. Quote Link to comment https://forums.phpfreaks.com/topic/57926-solved-fatal-errors/ Share on other sites More sharing options...
trq Posted July 1, 2007 Share Posted July 1, 2007 Use include_once instead of include. Quote Link to comment https://forums.phpfreaks.com/topic/57926-solved-fatal-errors/#findComment-287074 Share on other sites More sharing options...
rameshfaj Posted July 1, 2007 Share Posted July 1, 2007 why to include such things more than once?As u can use it many times once u include at the beginning of the page.Is there any idea behind including same page again and again? Quote Link to comment https://forums.phpfreaks.com/topic/57926-solved-fatal-errors/#findComment-287093 Share on other sites More sharing options...
gerkintrigg Posted July 1, 2007 Author Share Posted July 1, 2007 it outputs a watermarked, re-sized image to a list of images. The include needs to be referenced more than once to carry out the function within the include and output the image. Quote Link to comment https://forums.phpfreaks.com/topic/57926-solved-fatal-errors/#findComment-287106 Share on other sites More sharing options...
trq Posted July 1, 2007 Share Posted July 1, 2007 The include needs to be referenced more than once to carry out the function within the include and output the image. The include should only need to be included once, and the function called as many times as needed. You cannot define a function more then once, hence your error. Quote Link to comment https://forums.phpfreaks.com/topic/57926-solved-fatal-errors/#findComment-287120 Share on other sites More sharing options...
gerkintrigg Posted July 1, 2007 Author Share Posted July 1, 2007 right... Then I'll need to call the function I suppose... This is an unexpected drawback... oh well. thanks anyway. Quote Link to comment https://forums.phpfreaks.com/topic/57926-solved-fatal-errors/#findComment-287248 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.