[Solved]: PHP include [Solved]: PHP include
 

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]

Main Menu

[Solved]: PHP include

Started by Sin, March 27, 2008, 10:16:05 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Sin

I'm not PHP savvy, i can look at the code and kind of tell what it does, but i cant write it myself.

I got the PHP include from the Installation screen:


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



Copied and pasted it into my content space on my site, heres the errors im getting:

http://gfxdashboard.lasglade.com/gallery.php

I'm not sure if its not finding the files or the images themselves, or if im just doing the include path correctly.

My serber goes as such:

gfxdashboard
-cpg1416 (coppermine)
--albums
--bridge
--cpmfetch
Other CPG Folders

(Main site files, still in the gfxdashboard index)
-forum.php
-gallery.php (where im trying to get the php  include to work)
-index.php
-links.php

Am i just not getting the path right? it seems like thats what it is, but im not sure.

i understand how an include works, but something about this isnt clicking with me.

Sin

I couldnt find an Edit button... sorry for the double post..

Heres the link to my Coppermine gallery if you need that:

http://gfxdashboard.lasglade.com/cpg1416/

formulx

Try this:

<?php
  
include "cpg1416/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>



Your path was wrong. Also this was the wrong section. http://forum.coppermine-gallery.net/index.php/board,87.0.html is the board you needed to post it in.

formulx

Whoops my mistake forgot to change the path here too:
<?php
  
include "cpg1416/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("cpg1416/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>

Sin

Quote from: formulx on March 27, 2008, 10:29:23 PM
Whoops my mistake forgot to change the path here too:
<?php
  
include "cpg1416/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("cpg1416/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>


thanks for the help mate, worked like a charm.