Jump to content
MakeWebGames

Recommended Posts

Posted

Hi all. :) I haven't posted on here in some time, as I stopped coding for a few months due to exams. Now that I've got back into coding again, I need to refresh my memory...as such.

I've been on working on a mod and have come across an error, which seems like a simple one but I can't figure it out, yet I've racked my mind for a solution yet can't find one. This is the error I'm getting:

Fatal error: Call to undefined function furnidx() in /usr/home/*****/domains/*****/public_html/housing.php on line 168

Here is the area of code which is causing me hassle:

 

function buy_furniture()
{
global $db,$ir,$c,$h,$userid,$house,$userhouse,$house_settings;

if($db->num_rows($house) > 0)
{
switch($_GET['act2'])
{
	case 'idx': furnidx(); break;
	case 'furnlist': furn_list(); break;
	case 'buy': buy(); break;
	default: furnidx(); break; (this is line 168)
}
}

else
{
	die("You don't have a house. <a href = 'index.php' />Go Back</a>");
}

 

Before any of you say it, yes, I do have a function for each of the defined ones above. :) But for some reason I'm getting this error. Could anyone explain to me what I can do to sort this out, please? If you need me to post more of the code, I will.

Any help will be greatly appreciated. :)

Posted

Re: Function help

Nobody? :|

I know it may seem like an elementary question/problem, but I just can't solve it. I usually don't ask for help, but as I've just come back into coding, I need some, just to solve this little problem. :)

Posted

Re: Function help

Ahh yeah, that would be helpful, wouldn't it? :)

Here is function furnidx():

function furnidx()
{
	global $db,$ir,$c,$h,$userid,$house,$userhouse,$house_settings;

	print "Hello. Please select an option from below: 



	<font color = blue /><a href = '{$_SERVER['PHP_SELF']}?action=buyfurniture&act2=furnlist' />Buy Furniture</a></font>";
}

 

That is within the function buy_furniture().

Posted

Re: Function help

I think you can because the exact same method is used in the script yourgang.php. Within the gang_staff() function, there are other functions, like declaring war, managing the gang vault, etc. So I'm confused...what is the difference with what I'm doing?

Posted

Re: Function help

these functions:

case 'idx': furnidx(); break;

case 'furnlist': furn_list(); break;

case 'buy': buy(); break;

default: furnidx(); break; (this is line 168)

Need to be outside of

function buy_furniture()

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...