Jump to content
GIGN Forum

Fatal Error: Cannot Redeclare


kRi
 Share

Recommended Posts

Tātad mēģinu vienai lapai pievienot seolinks.lv un text-link-ads.com kodus, bet katrā kodā, protams, ir file_get_contents un līdz ar to errors:

Fatal error: Cannot redeclare file_get_contents_tla() (previously declared in /var/www/index.php:68) in /var/www/tla.php on line 50

Ko darīt, lai var ievietot abus kodus?

Link to comment
Share on other sites

PHP

<?

if ( !function_exists('file_get_contents_tla') ) {

     function 

file_get_contents_tla() {

          

// ...

     

}

}

file_get_contents_tla();

vēl smukāk būtu visas funkcijas iegrūst kaut kādā inc failā un taisīt tavu izsaukumu vroģi:

require_once 'blablabla.inc.php';

funkcija();

Link to comment
Share on other sites

Worm, danke.

Lai netaisītu jaunu topiku, ir vēlviens jautājums.

Piemēram, HLTV raksta demkas, kuras ar cron-jobota php skripta palīdzību tiek sazipotas. Problēma ir tur, ka zipo arī līdz galam neierakstītās. Kādā veidā sistēmai var iemācīt to, lai pagaida, kad demkas fails nepalielinās un tad zipo?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...