cooldude832 Posted October 21, 2009 Share Posted October 21, 2009 I have a class written in another file that handles my image resizing. Can I do this (php says I can't calling a non-existent class), but I know its there becuase the require doesn't fail above <?php <?php require_once("image_load.php"); ... .... function image_upload($tmp_name,$imgid){ $image = new easyImageEdit(); $image->load(UPLOADS.$tmp_name); $image->resizeToWidth(250); } ?> Link to comment https://forums.phpfreaks.com/topic/178423-can-i-call-a-class-inside-a-function/ Share on other sites More sharing options...
trq Posted October 21, 2009 Share Posted October 21, 2009 Yes, its perfectly valid. Link to comment https://forums.phpfreaks.com/topic/178423-can-i-call-a-class-inside-a-function/#findComment-940908 Share on other sites More sharing options...
cooldude832 Posted October 21, 2009 Author Share Posted October 21, 2009 then why am I getting: Fatal error: Cannot instantiate non-existent class: easyimageeditor in /homepages/26/d294404313/htdocs/kseego/scripts/functions.php on line 132 Link to comment https://forums.phpfreaks.com/topic/178423-can-i-call-a-class-inside-a-function/#findComment-940909 Share on other sites More sharing options...
cooldude832 Posted October 21, 2009 Author Share Posted October 21, 2009 sorry how this get in the ajax baord went to php? Link to comment https://forums.phpfreaks.com/topic/178423-can-i-call-a-class-inside-a-function/#findComment-940910 Share on other sites More sharing options...
trq Posted October 21, 2009 Share Posted October 21, 2009 Is the class easyimageeditor or easyImageEdit ? Make your mind up. Link to comment https://forums.phpfreaks.com/topic/178423-can-i-call-a-class-inside-a-function/#findComment-940923 Share on other sites More sharing options...
Gayner Posted October 21, 2009 Share Posted October 21, 2009 then why am I getting: Fatal error: Cannot instantiate non-existent class: easyimageeditor in /homepages/26/d294404313/htdocs/kseego/scripts/functions.php on line 132 Please supply us that line of code, in ur include maybe we can help! Link to comment https://forums.phpfreaks.com/topic/178423-can-i-call-a-class-inside-a-function/#findComment-940925 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.