You are here: error due to function definition « All PHP « IT news, forums, messages
error due to function definition

Posted by kenoli on 12/28/07 01:03

I want to call a function if it has been defined and not call it if it
hasn't. I am using this code:

if (function_exists(editForm())) { editForm(); }

I also tired:

if (editForm()) { editForm(); }

When I first implement this conditional in this script, the function
has not yet been defined. Later, when the script is run again after a
post submit, the function gets defined and the conditional then
results in the function being called.

When I run this on my local machine using PHP Version 5.2.2 both of
these scripts run fine, doing nothing when it is not defined and
calling it when it is. It shows no errors.

When I upload this to my web server which is using php 5.2.5, and run
this script I get the following error:

"Fatal error: Call to undefined function editform()"

when it gets to this conditional. Can anyone tell me what is going on
here. Has something changed between php 5.2.2 and 5.2.5?

I have searched everywhere and not been able to find any explanation
for my problem.

How do I accomplish this procedure?

Thanks,

--Kenoli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация