Jump to content

Call to undefined function - but it IS defined... help?


dpenguin71

Recommended Posts

Lines 84-88:
 

if (empty($_POST['HomeInfo'])) {
$infoErr = "Information about your home is required. ";
} else {
$HomeInfo = test_input($_POST['HomeInfo']);
}


Lines 120-125:
 

function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}

So, why is it saying it is undefined, when it clearly is defined? And, more importantly,
how do I fix it?

Lines 120-125 are probably inside of a conditional statement, so that they don't become defined until that conditional statement is true.

 

function definitions should all be grouped together and come near the start of your code or even be in a separate file that gets included near the start of your code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.