Page 1 of 1

Fatal error: Call to undefined function

Posted: Fri Jul 23, 2010 1:38 pm
by srainsdon
ok so to start out this is what i am running

Code: Select all

Host Server:
PHP Version: 5.2.13
Display Errors: On
Error Level: Not E_ALL
Register Globals: Off

My Ubuntu System
PHP Version: 5.2.10-2ubuntu6.4
Display Errors: On
Error Level: Not E_ALL
Register Globals: Off

the problem i am having is my index.php is giving me this error

Code: Select all

Fatal error: Call to undefined function head() in /home/abrtest/test_html/index.php on line 16
here is the code in question

Code: Select all

include("./include/session.php");

$Page = $_GET['Page'];
echo Head("index");
head is defined in function.php which is included in session.php her is Head()

Code: Select all

/*---------------------------------------------
function Head returns header and menu information
---------------------------------------------*/

function Head($name){
	global $session;
	$message .= "<html><head><title>Material Recovery: " . $name . "</title></head><body>";
	$message .= "<h1>Logged In</h1>";

	$message .= "Welcome <b>$session->username</b><br><br>";
	if($session->logged_in){
		$message .= "[<a href=\"addaddress.php\">Add Address</a>] &nbsp;&nbsp;";

		$message .= "[<a href=\"userinfo.php?user=$session->username\">My Account</a>] &nbsp;&nbsp;";

		$message .= "[<a href=\"useredit.php\">Edit Account</a>] &nbsp;&nbsp;";
	if($session->isMapUser()){
      $message .= "[<a href=\"mapcode.php\">Map</a>] &nbsp;&nbsp;";
		}
   if($session->isAdmin()){

      $message .= "[<a href=\"../admin/admin.php\">Admin Center</a>] &nbsp;&nbsp;";

   }
if($session->isMapAdmin()){
      $message .= "[<a href=\"index.php?Page=admin/review.php\">Review Submissions</a>] &nbsp;&nbsp;";

		}   

	$message .= "[<a href=\"../process.php\">Logout</a>]";
	$message .= "<br /><br />";
	return($message);

}
else {
	   echo "Welcome <b>$session->username</b>, you are not logged in. Click <a href=\"index.php?Page=Login\">Here</a>";

}

}
btw this all works on my ubuntu system at home but i try to up load it and get this error i have tested it and all the other functions from other includes work but not the ones from my function.php

thank you very much for your help...

Re: Fatal error: Call to undefined function

Posted: Fri Jul 23, 2010 1:52 pm
by Weirdan
Change your include()s to require() and see if it would give you more information. It's likely some of the files are not included due to the differences in include_path settings.

Re: Fatal error: Call to undefined function

Posted: Fri Jul 23, 2010 1:57 pm
by srainsdon
ok changed all my include() to require() same error message nothing about any of the required files not being there also checked my error log for the host and nothing... thank you for that suggestion