I can not get code to work I can not get code to work
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

I can not get code to work

Started by ThunderBucks, May 19, 2007, 01:50:34 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ThunderBucks

I have just installed the cpmfetch and all worked and I seen the pics and the php code. I copied the code and modified it to how it is on my server <?php
  
include ".cpg1410/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm(".cpg1410/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>


And this is all that displays on the page. cpm_viewLastAddedMedia(1,4); $objCpm->cpm_close(); ?>
I do not have a lot of programing and coding knowledge so can someone please help me out on what I need to do to get this to work?? My server does support php I do know that, but just can't understand why this won't show up for me.

vuud

Quote from: ThunderBucks on May 19, 2007, 01:50:34 AM
I have just installed the cpmfetch and all worked and I seen the pics and the php code. I copied the code and modified it to how it is on my server <?php
  
include ".cpg1410/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm(".cpg1410/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>


And this is all that displays on the page. cpm_viewLastAddedMedia(1,4); $objCpm->cpm_close(); ?>
I do not have a lot of programing and coding knowledge so can someone please help me out on what I need to do to get this to work?? My server does support php I do know that, but just can't understand why this won't show up for me.


Do you have that code in a file whos name ends with ".php"?



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

ThunderBucks

I added it to a file called fetch.php and uploaded it to the cpmfetch directory but now how do I call it up on my webpage? Sorry I am not getting this and really appriciate your help and patients with me here.  :-\

vuud

Quote from: ThunderBucks on May 26, 2007, 05:37:53 PM
I added it to a file called fetch.php and uploaded it to the cpmfetch directory but now how do I call it up on my webpage? Sorry I am not getting this and really appriciate your help and patients with me here.  :-\

That code should go right in the page you want to display it on.  It should be a php page.  If you are trying to include it into an HTML page, you have a slightly rough road ahead of you.

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

reas0n

Quote from: vuud on May 29, 2007, 07:27:47 PM
That code should go right in the page you want to display it on.  It should be a php page.  If you are trying to include it into an HTML page, you have a slightly rough road ahead of you.



can you explain how to get it onto an html page because thats where im trying to put it and i get the same error

vuud

Quote from: reas0n on June 25, 2007, 11:36:15 PM
can you explain how to get it onto an html page because thats where im trying to put it and i get the same error

You have a few options

1.  Cfimageget.php - this is the easiest but is geared toward one image really

2.  HTML Server side include - if it works with your server, milage varies depending on your host.  If it does work, you can do all your cpmfetch stuff in that other file and include it.

3.  The javascript thing remdex did for cpmfetch - while slightly limited for now, it may be the best way to do it as SSI fades away.

4.  The by far, easiest way is to rename all your pages to php and just insert the code.  If you have 100's of pages this may not be the best, but if you only have a dozen or so pages, it may be worth the effort.  PHP gives you lots of cool stuff.

Am I forgetting anything?
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

reas0n

problem solved on my end....i changed something on my server so that it reads html pages through the php engine