coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: sovev on June 29, 2004, 01:29:13 PM

Title: [solved] Help with removing displayed PHP code
Post by: sovev on June 29, 2004, 01:29:13 PM
I'm a complete PHP novice so you'll have to humour me.

I've just installed coppermine and now at the bottom of every page I have weird PHP code displayed. Can anyone suggest how to hide this code?

See for yourselves at http://www.sovev.com/copper/

Thanks in advance.

The code is:

flush(); break; } } pagefooter(); ob_end_flush(); // Speed-up the random image query by 'keying' the image table if (time() - $CONFIG['randpos_interval'] > 86400) { $result = db_query("SELECT count(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1"); $nbEnr = mysql_fetch_array($result); mysql_free_result($result); $pic_count = $nbEnr[0]; $granularity = floor($pic_count / RANDPOS_MAX_PIC); $result = db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET randpos = ROUND(RAND()*$granularity) WHERE 1"); $result = db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . time() . "' WHERE name = 'randpos_interval'"); } ?>
Title: Re: Help with removing displayed PHP code
Post by: Joachim Müller on June 29, 2004, 07:12:57 PM
did you edit any files before uploading them to your server? If not, one (or more) of your files got corrupted during upload. Just get a fresh coppermine package and upload it (overwrite the existing files) - don't worry, nothing will break. Make sure you choose the right ftp-mode during upload.

GauGau
Title: Re: Help with removing displayed PHP code
Post by: sovev on June 30, 2004, 11:50:27 AM
Quote from: GauGau on June 29, 2004, 07:12:57 PM
Just get a fresh coppermine package and upload it (overwrite the existing files) - don't worry, nothing will break. Make sure you choose the right ftp-mode during upload.

Thanks for the reply. If I re-upload the whole package won't that overwrite all my settings?

Also (excuse the stupid question) which ftp mode shoudl I use?
Title: Re: Help with removing displayed PHP code
Post by: Casper on June 30, 2004, 12:57:25 PM
Do not overwrite the albums folder, or the include folder.  But do overwrite the files inside the include folder, EXCEOT the config.inc.php and install.lock.

You should use auto mode if your ftp program has it, or binary mode for pics, ASCII for all others.
Title: Re: Help with removing displayed PHP code
Post by: Joachim Müller on June 30, 2004, 05:10:24 PM
in fact, the coppermine packages that are being distributed don't contain the files config.inc.php nor install.lock, so it's save to replace all files.

GauGau
Title: Re: Help with removing displayed PHP code
Post by: Casper on June 30, 2004, 06:12:45 PM
Yes, but I was just trying to make it clear not to just overwrite the entire folder, which would lose these files.
I made this mistake once when I first started. ;)
Title: Re: Help with removing displayed PHP code
Post by: sovev on June 30, 2004, 07:40:51 PM
 :) Thanks - it worked a treat!