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: [Solved]: PHP include  (Read 5423 times)

0 Members and 1 Guest are viewing this topic.

Sin

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
[Solved]: PHP include
« on: March 27, 2008, 10:16:05 pm »

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:

Code: [Select]
<?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.
« Last Edit: March 28, 2008, 03:24:49 pm by Nibbler »
Logged

Sin

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: PHP include
« Reply #1 on: March 27, 2008, 10:18:50 pm »

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/
Logged

formulx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: PHP include
« Reply #2 on: March 27, 2008, 10:21:31 pm »

Try this:
Code: [Select]
<?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.
Logged

formulx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: PHP include
« Reply #3 on: March 27, 2008, 10:29:23 pm »

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

Sin

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: PHP include
« Reply #4 on: March 28, 2008, 05:55:30 am »

Whoops my mistake forgot to change the path here too:
Code: [Select]
<?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.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.