jw_d Posted September 20, 2009 Share Posted September 20, 2009 I have a PHP page that runs fine on one server. On a different server I am receiving the error: "Fatal error: Call to undefined function p() in ......" This is the code generating the error: <?php include_once('common.php'); if(p()->send) { $users_acct=$db->users_acct->email(p()->email); if(count($users_acct) > 0) { $headers = "From:info@xxxxx.com"; $subject = "Password Reminder"; $message="Recently you requested a password reminder from xxxxxxx.\n\nYour password: {$users_acct->password}\n\nRegards,\xxxxxxxxxx"; mail($users_acct->email,$subject,$message,$headers); echo msg("Your password has been sent to {$users_acct->email}."); } else echo error_msg('The E-mail you provided is not registered with us.'); } ?> I'd certainly appreciate any help if you know what this is telling me. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/ Share on other sites More sharing options...
redarrow Posted September 20, 2009 Share Posted September 20, 2009 looks like it can not find the database connection. is that what in common. Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921931 Share on other sites More sharing options...
jw_d Posted September 20, 2009 Author Share Posted September 20, 2009 Yeah. That's in the common. It's connecting fine to the DB, because I changed the password in the common and it then gives an error trying to connect to DB. Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921934 Share on other sites More sharing options...
redarrow Posted September 20, 2009 Share Posted September 20, 2009 try it this way pal. <?php include("common.php"); ?> if it works then use require_once() ok. <?php require_once("common.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921935 Share on other sites More sharing options...
jw_d Posted September 20, 2009 Author Share Posted September 20, 2009 Shoot. Unfortunately that didn't work either. It seems to be connecting fine to that to that file (and therefore connecting to the DB). I appreciate the assistance though! Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921937 Share on other sites More sharing options...
redarrow Posted September 20, 2009 Share Posted September 20, 2009 stick a /in front of common.php got to be that? Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921939 Share on other sites More sharing options...
PFMaBiSmAd Posted September 20, 2009 Share Posted September 20, 2009 It's likely you have some short open tags in the common.php file that is causing part of the php code in it to be ignored. Since part of common.php works and part does not, you would need to post it for anyone here to be able to directly help you with why your function is not being seen. Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921942 Share on other sites More sharing options...
knsito Posted September 20, 2009 Share Posted September 20, 2009 if function, isnt it $p->send() $p->email() or vars $p->send $p->email ? Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921958 Share on other sites More sharing options...
redarrow Posted September 21, 2009 Share Posted September 21, 2009 Let us see all of common.php please. (very interesting) Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921961 Share on other sites More sharing options...
jw_d Posted September 21, 2009 Author Share Posted September 21, 2009 Thanks for the advise. Here is the common: <?php ini_set('include_path',ini_get('include_path').':/home/content/c/u/s/***/html/admin/classes/pearMain'); include_once('/home/content/c/u/s/***/html/admin/classes/pear/DB-1.6.8/DB.php'); include_once('classes/class.php'); $_INFO_NAME = "***"; $_INFO_KEEPER ="***"; $_INFO_CODE = "***"; $_ACCESS_CODE = "***"; $_CONN = "mysql://".$_INFO_CODE.":".$_ACCESS_CODE."@".$_INFO_KEEPER."/".$_INFO_NAME.""; define("_DB_CONN",$_CONN); define("PATH","/home/content/c/u/s/***/html/admin/"); define("FCKUPLOADPATH","/***/admin/uploads/"); define ("BS_DIR","/home/content/c/u/s/***/html/"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921980 Share on other sites More sharing options...
PFMaBiSmAd Posted September 21, 2009 Share Posted September 21, 2009 That's not the code were the function p() is defined. Keep looking. Also, add the following two lines of code immediately after your first opening <?php tag in the main code to get all php detected errors to be displayed - ini_set("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/174936-need-some-help-bad-fatal-error-call-to-undefined-function-p-in/#findComment-921998 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.