Syntax of filename + path in a php


Currently contains 1 post


July 30, 2012 15:28

mike tran

brentwz (edit) Topic created 9 months ago Edit Topic
Recently signed up with Sierra Trading Post as an Affiliate, then found out about a few Sierra Trading Post affiliate tools at — from a STP email promo to us.

Just out of interest, I decided to have a go at the Sierra Trading Post Affiliate Store. I’ve managed to get partway there but as the instructions are a bit thin on the ground for non-code people like myself, I’m asking for a bit of help to finish it off.

I’ve created a database through MYPhpAdmin on a domain of ours & have successfully run the install.php, created the config.php as directed from the browser after-install message & have FTPed the datafeed.txt file to the domain subdirectory.

Now I’d like to know: What do I type into the parse_feed.php file for the datafeed file name & remote directory, to enable me to stock the shop, so to speak, where “filename” & location of datafeed file mentioned below >>

<?php require_once(‘db.php’); require_once(‘functions.php’);

$filename = ‘..//datafeed/datafeed.txt’; // Location of the datafeed file.

if($conn = db_connect()) {
// Load options
$options = array();
blah-blah …
My remote directory path for the datafeed file is so please tell me the code required for this, thanks.

Also, what CHMOD do I set the \datafeed\ folder permissions to for this to work?

Don’t know where else to turn to on this. Thanks for your assistance, folks.

Cheers Brent Williamz

Message edited by brentwz (edit) 9 months ago

profexorgeek (edit) – 9 months ago Edit Post

Hi Brent, I’m our Android developer. I used to manage our affiliate program and have written tons of PHP (though I didn’t write the demo store).

Unfortunately our affiliate store is a little “dusty.” It was built a long time ago and it hasn’t seen a lot of use so we haven’t supported it very well. Our documentation is, as you’ve discovered, a little thin (mostly non-existent). That being said, it’s a great starting point if you want to build a custom PHP affiliate store. Just keep in mind that best practices in PHP have evolved a lot since it was written!

Something like this might work for the datafeed path:

$filename = $SERVER[’DOCUMENTROOT’] . ‘/datafeed/datafeed.txt’;
As far as CHMOD permissions go I think 775 should work. Worst case you could do 777 but that’s less secure.

Hopefully that helps. -Justin

profexorgeek (edit) – 9 months ago Edit Post

Also, I forgot to mention that it might be a lot easier to work with our API. With the API you don’t have to worry about managing a database, downloading the latest feeds, etc. It has live product data that you can pull directly. In addition to that, it supports sorting, filtering, pagination and many other useful things. If you wanted to start small you could write a little JavaScript widget that pulled product data in to your existing blog or website to create small, dynamic ads.

Chris Lange (edit) – 9 months ago Edit Post

Hi Brent, I’m the Web Operations Manager here at Sierra Trading Post, and one of my responsibilities is to keep the demo store up and running at

After getting an email about your questions, I took a look at the code in question earlier today, and found that even our demo store is having problems with some of the changes we’ve introduced recently in the Product Datafeed, which might be related to why you are seeing problems as well.

I’m going to be working on getting the code in question up on Github over the next few days, and starting an effort internally here at Sierra Trading Post to update the code, and provide some documentation. I’ll post the information for this project once I have it online!

brentwz (edit) – 9 months ago Edit Post

Thanks for the reply, folks. Already spent too much business time/cost on this. Too bad. Those affiliate tools looked simpler than they actually are — for salespeople.

Sorry I bothered you on this. I’ll just give it a miss. Shall rework our Sierra Trading Post niche websites we’ve just setup — to use our subscription instead. At least we can get easy, AUTO-UPDATING Sierra Trading Post product datafeeds through them.

May I suggest you get rid of the links to from Aaron Roybal, Affiliate Manager’s promo email TEMPLATE until the aff. tools & code are freshened up; might save other affiliates a bit of grief too.

Reply to thread