Explore Area error

"Fatal Error: Class ExploreencarsiforestController either does not exist, or has its include path misconfigured!"

That always happen when i tried to add a explore system. And as since i dosn't even know what Php is, i can't fix it.
I did everything right as the tutorial has. But as i said, i still gets that error.

So...how to fix it?

 
EDIT: So I visited the page on your site and the url is correct. Replicated it myself and it turns out that somewhere, the file names and class names don't match up. Do you have the files named exploreencarsiforest.php and exploreencarsiforestview.php (no capital letters)? Then in exploreencarsiforest.php, you need to make sure that the class line looks like this:

Code:
class ExploreencarsiforestController extends AppController{
 
Last edited by a moderator:
Now it says....
"Fatal error: Cannot redeclare class ExploreencarsiforestController in /home/enchante/public_html/view/exploreencarsiforestview.php on line 67"

 
That error means that class 'ExploreencarsiforestController' has already been declared somewhere else, and so can't be declared again. I don't know much about the application you are using to make your site.

But check that file to see if the statement 'class ExploreencarsiforestController ' is found more than once. If it's not in that file more than once then it's already been declared in another file somewhere which you'll want to find. Some editors let you do a text search over all project files at once, if you have one that does search for it and find it. 

Once you find the duplicate you'll want to remove one of them.

 
That error means that class 'ExploreencarsiforestController' has already been declared somewhere else, and so can't be declared again. I don't know much about the application you are using to make your site.

But check that file to see if the statement 'class ExploreencarsiforestController ' is found more than once. If it's not in that file more than once then it's already been declared in another file somewhere which you'll want to find. Some editors let you do a text search over all project files at once, if you have one that does search for it and find it. 

Once you find the duplicate you'll want to remove one of them.
I actually saw this on "exploreencarsiforestview". Don't know if i must remove it.

 
The phrase  'class ExploreencarsiforestController ' is used on your project twice followed by content that is enclosed in brakets '{' and '}', the second time  'class ExploreencarsiforestController ' is found, it and it's content needs to be removed.

 
So it needs to be removed anyway?
Because i think that it's an important part, because it haves the code needed to get stuff from exploring. It's a view page.

Edit: looks like that i found a way to fix it without removing anything.

 
Last edited by a moderator:
I don't know what you did. But that error is saying that the class is appearing twice, and should only be in there one time. This line,   'class ExploreencarsiforestController ' should not be in the project or any file more than once. If you renamed something earlier to that, you could have introduced the error yourself and it may require it being renamed again instead of a full removal. But this is ONLY if you are finding that line twice. 

Another issue it could be, is if you have an include 'exploreencarsiforestview.php' or require 'exploreencarsiforestview.php' statement instead of include_once, require_once. And in that case the statements should be switched to include the '_once' tag instead. 

Adding the _once on the ends means don't include this file more than one time no matter how many times it's referenced. If you completely remove the include or require statement, then the class will not be findable, which was your first error. 

What did you do that you think may have solved the issue?

 
Did you make sure you have the right code for an explore page that requires an item?

$item = "BASIC EXPLORING KIT";
$hasitem = $mysidia->db->select("inventory", array("quantity"), "itemname ='{$item}' and owner='{$mysidia->user->username}'")->fetchColumn();
if($hasitem){
//Put explore code here!
}
else{
//What happens if the user doesn't have the item goes here!
}


If you do have something similar to that (it might be a bit different, this is just the basic way), then are you sure you actually own that item yourself? When you created the item, is the name in all caps like that? If not, the names have to be exactly the same since it's case sensitive.

 
It's not caps, it just has all word with just the first letter as caps. The caps are just to make users tuned about what they must do.

Edt: Looks like that it worked, but the message "you doesn't have this" is still here, but it's togheter with the "you have this" message.
So how to remove the "you doesn't have this" message when you have the item?

And how to make a refresh link on the page? So users may click it instead of clicking their browser refresh button or Ctrl + F5?

 
Last edited by a moderator:
Back
Top