Re: [Magpierss-general] How to integrate several feeds on one php-page?
Status: Beta
Brought to you by:
kellan
From: Marco <ci...@bi...> - 2004-11-13 20:36:14
|
|newsfeed an error message is printed out: "Fatal error: Cannot |redeclare date_cmp() (previously declared in |/home/www/web58/html/netobserver/newsfeed01.php:14) in |/home/www/web58/html/netobserver/newsfeed02.php on line 17". | Methoz, I see two solutions to your problem: 1) Don't redeclare the date_cmp() function in your second script: when you call the second script the function in the first one is still in scope, so you can still call it. Alternatively just create a new script, say utils.php, where you define the date_cmp() function, and require_once('utils.php') it in both of your newsfeed scripts. 2) Create a single newsfeed script, holding the code of both newsfeed's (but with date_cmp declared only once). IMO the second solution would be better, as it's easier to maintain. (Although I guess there's a pretty valid reason if you created two files, isn't there?) Good luck, -m _________________________________________________ -.-. .. .--. .--.-. -... .. - .-.-.- -.-. .... |