PDA

View Full Version : include/require- redecare function


joyce
Thu 6th Jun '02, 4:48am
hi, my problem sounds like this..
i have a page, s.php, works well. in s.php, i have to include header.php and 1.php.

in my header.php, i already include 1.php. so when i include header.php in 1.php, i got error...says...cannot redeclare...a function. so i thought i dun need to include 1.php in my s.php and it should works. but it didn't.

what should i do? i tried using include_once and require_once but the error is still there. pls help..

scoutt
Thu 6th Jun '02, 7:59pm
so if you are including it in the s.php why include it in header.php?

joyce
Fri 7th Jun '02, 3:01am
i need to include it in header because i need to use some functions in that page. and...the header .php is not only for my s.php. basically every single page i also include header.php

scoutt
Fri 7th Jun '02, 9:57am
what I meant was if you include header.php and 1.php on the same page, the header should be able to use the variables in 1.php (if it is included before the header) and you won' t have to include it twice.

or you can include it by using "include_once()" as that way it will include it if it is not already included, but I think it will be. no errors returned if it is all ready included from before.