Forum Moderators: coopster

Message Too Old, No Replies

Products feed

Getting it working in a cms

         

Melter

1:53 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



I'm trying to integrate Amazon Products Feed into a content management system. I've uploaded the script and the templates that are called by the script and the script works.

However, I've set up a page in the cms to call the script and when I use the given code:


<?php
include_once("http://www.mysite.com/cgi-bin/amazon_products_feed.cgi");
?>

nothings happens.

Any suggestions?
btw - I have swapped 'mysite.com' for my domain name, I know you're not supposed to display web addys on this forum.

Thanks

bcolflesh

2:02 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From the PHP man page:

us4.php.net/include-once

Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled.

So is PHP > 4.3.0?
Is allow_url_fopen enabled?
The function is case sensitive - are your filenames correct?

Melter

2:16 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



I'm no expert at this so take things steady with me.


So is PHP > 4.3.0?

PHP is 4.3.2.

Is allow_url_fopen enabled?

Not really sure what this is or where I'd find it. The content page created is labelled as an article so would this be in the main article.php?

The function is case sensitive - are your filenames correct?

Yes. I've checked the script by using the full address in the address bar and a product page appears. So I can't work out why it won't appear within my cms page.

bcolflesh

2:31 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not really sure what this is or where I'd find it. The content page created is labelled as an article so would this be in the main article.php?

Make a phpinfo.php page and check the PHP Core config section - or look directly in your PHP.ini

Melter

2:44 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



erm...I don't have access to the php files as they're on my hosts server. Can I check anything through cpanel? Or is there something else I can do?

If making a phpinfo.php page is the answer then what do I need to put on this page?

Nick_W

2:47 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Upload this:

<?
phpinfo();
?>

Nick

Melter

2:52 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



Nice. Okay it says:
allow_url_fopen - (Local value) On, (Master value) On.

What next?

bcolflesh

3:10 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What happens if you do a straight include w/out the "_once"?

Melter

3:12 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



Nothing again.

coopster

3:26 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I noticed the extension on your included file is .cgi. Is your PHP parser setup to handle this extension?

coopster

3:36 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I noticed the extension on your included file is .cgi. Is your PHP parser setup to handle this extension?

<edit>I'm assuming the included file, "http://www.mysite.com/cgi-bin/amazon_products_feed.cgi", was meant to be processed as PHP. Correct me if I am wrong.</edit>

bcolflesh

3:40 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some possible solutions in this thread:

forums.devshed.com/t24207/s.html?highlight=Converting+RealAudio+Files+into+format+(.wav)

Melter

5:16 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



Okay had a look at those solutions and though interesting they didn't work.

I noticed the extension on your included file is .cgi. Is your PHP parser setup to handle this extension?
<edit>I'm assuming the included file, "http://www.mysite.com/cgi-bin/amazon_products_feed.cgi", was meant to be processed as PHP. Correct me if I am wrong.</edit>

Sorry not sure I follow you here. If the page is displayed when called in the address bar then it works okay, yes/no? Or am I missing the point?

coopster

7:03 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If the page is displayed when called in the address bar then it works okay, yes/no? Or am I missing the point?

Yes, the page works OK, but no, you can't use the PHP parser (via include [us4.php.net]) to process it if it isn't PHP. See example 11-5 in the link. There are alternatives listed in bcolflesh's post#12 as well as in the link included in this post to get your processing accomplished.