Re: include file



student4lifer@xxxxxxxxx wrote:
Hello,

I have a.php that includes functions.php and b.php that also uses
some function in functions.php as follows.

<? php
include("functions.php");
include ("b.php");
?>

For some reason, I got error message "somefunction() not found"
originated from b.php when I ran a.php. When I tried to ALSO include
functions.php in b.php, I got error message
Fatal error: Cannot redeclare somefunction() (previously declared in
functions.php. What am I missing? Thanks.

Nothing - it should work. Ensure your spelling is correct, and that you are including the files you think you are.

If that doesn't work, you'll need to post some code so e can see what you're doing.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: include file
    ... For some reason, I got error message "somefunctionnot found" ... Cannot redeclare somefunction() (previously declared in ...
    (comp.lang.php)
  • include file
    ... For some reason, I got error message "somefunctionnot found" ... Cannot redeclare somefunction() (previously declared in ...
    (comp.lang.php)
  • Re: on input form showing error message for duplicate entry.
    ... | Subject: Re: on input form showing error message for duplicate entry. ... |> same validation in php since not all your visitors/customers will have ...
    (alt.php)
  • Re: [PHP] Re: http request problem
    ... while i am trying to access to another file, from another server it run ... this is the error message i get: ... browser on the same network where it fails in the PHP script? ... know your requests actually hit the server, ...
    (php.general)
  • PHP logs not working, and unable to send mail through sendmail via PHP
    ... am unable to view my php error log. ... logging and my mail options and suggest some things for me to try ... error displaying on production web sites. ... String to output before an error message. ...
    (comp.lang.php)