dav3 Posted June 9, 2009 Share Posted June 9, 2009 Hey guys i tried searching for a topic like this but i couldn't find anything that really helped me solve my own issue. I am a php noob and got help designing the pages of my site that needed php coding. This specific issue is with a admin panel where i can swap banners on my site when my product sells and replaces it with a new picture. www.haloprogaming.com/ ----> lvl 50s As you can see it is set with default banners that i should be able to exchange but i get the error described in the title. I looked at the coding and here are lines 88 - 100 which is including the line 94 where the error occurs. /* Scan the dir and recursively unlink */ $files = scandir($path); foreach($files as $filename) { if($filename == '.' || $filename == '..') continue; $file = str_replace('//','/',$path.'/'.$filename); 94>>> self::unlink($file); <<<<94 }//end foreach /* Remove the parent dir */ if(!@rmdir($path)) return false; return true; } Thanks so much for the help. -Dave P.S. Exact error code: Fatal error: Cannot access self:: when no class scope is active in /home/halosinf/public_html/haloprogaming.com/cp1/editlogoprocess.php on line 94 Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted June 9, 2009 Share Posted June 9, 2009 Fatal error: Cannot access self:: when no class scope is active It is as you posted in your title. you can't use self outside a class scope. If it is suppose to delete a file just remove "self::" Quote Link to comment Share on other sites More sharing options...
dav3 Posted June 9, 2009 Author Share Posted June 9, 2009 It is not to delete an item. He set the admin panel up so that when i have a banner on my site i can create a new banner with the same attributes and exchange it by using this admin panel. When switch them though that is the error i get. -Dave Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 10, 2009 Share Posted June 10, 2009 It is not to delete an item. He set the admin panel up so that when i have a banner on my site i can create a new banner with the same attributes and exchange it by using this admin panel. When switch them though that is the error i get. -Dave What in the world did you just say? Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted June 10, 2009 Share Posted June 10, 2009 It is not to delete an item. He set the admin panel up so that when i have a banner on my site i can create a new banner with the same attributes and exchange it by using this admin panel. When switch them though that is the error i get. -Dave Is this what you are saying? Someone has build the backend (admin panel as you name it) for you. One of the features of your backend is to change a banner. This banner is visible on frontend of your website(the website visible to the users that visit the site). My question to you is Can you change the image inside that banner and does it make you upload a new one? Quote Link to comment Share on other sites More sharing options...
dav3 Posted June 12, 2009 Author Share Posted June 12, 2009 Ok so i found out that in line 94 it just as the tag "self" but it needs to be assigned in a class. Here is what my server provider has said. "It seems it's more coding issue than PHP configuration issue. It might work with some PHP versions but it doesn't work with PHP 5.2.9 as far as I can see. I tried enabling PHP4 version and it reproduced another error. Most probably that the call should be inside a class declaration, instead of free within the php tags. Thank You Sergey" I guess i need to assign a class with it but i have no idea how to do it. If anyone knows what is going on please any help would be appreciated. If there is any physical work you have to do to the coding i can pay you for your time just let me know. Thanks. -Dave 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.