Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Help with inserting the PHP code...  (Read 5563 times)

0 Members and 1 Guest are viewing this topic.

Naif

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Help with inserting the PHP code...
« on: March 30, 2007, 10:53:47 pm »

Hello

I have been trying to add the Example shown in the tutorial to a html page in my website, but I get some error messages when that page is loaded. I have made some research and tried to figure out what is wrong in the php code, but I'm still clueless... I did the Cpmtest and that was okay.

Here the php script I wrote:

<?php   
include "/galeria/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/galeria');
$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewLastAddedMedia (2,4);
$objCpm->cpm_close();
?>

And these are the errors I receive: Warning: include(/galeria/cpmfetch/cpmfetch.php) [function.include]: failed to open stream: No such file or directory in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 46

Warning: include() [function.include]: Failed opening '/galeria/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 46

Fatal error: Class 'cpm' not found in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 47

My Coppermine gallery is installed in www.theothersize.com/galeria
« Last Edit: April 03, 2007, 02:47:43 am by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Help with inserting the PHP code...
« Reply #1 on: March 31, 2007, 12:40:18 am »

Hello

I have been trying to add the Example shown in the tutorial to a html page in my website, but I get some error messages when that page is loaded. I have made some research and tried to figure out what is wrong in the php code, but I'm still clueless... I did the Cpmtest and that was okay.

Here the php script I wrote:

<?php   
include "/galeria/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/galeria');
$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewLastAddedMedia (2,4);
$objCpm->cpm_close();
?>

And these are the errors I receive: Warning: include(/galeria/cpmfetch/cpmfetch.php) [function.include]: failed to open stream: No such file or directory in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 46

Warning: include() [function.include]: Failed opening '/galeria/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 46

Fatal error: Class 'cpm' not found in /home/.cutie/naif/theothersize.com/acercagaleria.php on line 47

My Coppermine gallery is installed in www.theothersize.com/galeria


the path for the include statement is a relative path from where the script is.  So if your test page is in the root of your web site it would be:

include "./galeria/cpmfetch/cpmfetch.php";

The dot means "this directory" - without it, it means the top of the file system structure. 

Do not change the new cpm though - that one seems right.



Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Naif

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Help with inserting the PHP code...
« Reply #2 on: March 31, 2007, 03:43:56 pm »

Thanks, it works very well now!  :D
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.