GoldenCan provides a nice way to make commissions through Affiliate Marketing. Basically, GoldenCan provides a product feed that is formated for pagination, product searches, and product information. One could use this feed to insert into a website dedicated to Affiliate Marketing or maybe one where it is content relevant. Depending on the web host, there may or may not be "out of the box" success with GoldenCan's code.
I use GoldenCan's PHP code to embed my feeds, since it is search engine friendly - "spiderable", in other words. Using Javascript might appear cleaner and will definitely take some of the weight off of the server's CPU, but does nothing for search indexing and folks, it is all about having your site show up in the search engines' indexes. No indexing and no advertising = zero visitors (unless they happen along randomly).
OK. A typical PHP code block from GoldenCan appears as follows:
<?php // standard GoldenCan method $SID="YOUR_SID"; $IPAddress = urlencode($_SERVER['REMOTE_ADDR']); $UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']); $Host=urlencode($_SERVER['HTTP_HOST']); $PageURL=urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']); $URL="http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID; $URL=$URL.'&Host='.$Host; $URL = $URL.'&PageURL='.$PageURL; $URL = $URL.'&IPAddress='.$IPAddress; $URL = $URL.'&UserAgent='.$UserAgent; include($URL); ?>
Workaround Option 1
The above block may or may not work. It will not work if the web host has "allow_url_fopen = Off" or "allow_url_include = Off" set in the php.ini file. A quick workaround to these two settings is to simply create a php.ini file that will reside in the root folder of the site - that is not to say in the root folder of all your sites, i.e. if your site sits at /sites/joomla/site1/, then php.ini needs to be placed under /sites/joomla/site1/[here]. I wrote about this solution a good while back and it can be found [here].
*IF* you have no control over these files and/or adding per folder directives by inserting a php.ini file as mentioned above, then your host will need to do it (if they will) or you are out of luck with this option.
Workaround Option 2
Use PHP's cURL library. If your host does not support the cURL library, I would seriously recommend finding a better host. Assuming they do, then use the following code which will *NOT* require a php.ini directive:
<?php // GoldenCan cURL method $SID="YOUR_SID"; // grab this from the PHP that GoldenCan provides $Host=urlencode($_SERVER['HTTP_HOST']); // do not need to change anything here $URL = "http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID; // this is standard, no need to change anything $PageURL = urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']); // do not change $IPAddress = urlencode($_SERVER['REMOTE_ADDR']); // do not change $UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']); // do not change $Host=urlencode($_SERVER['HTTP_HOST']); // do not change $URL=$URL.'&PageURL='.$PageURL.'&Host='.$Host.'&IPAddress='.$IPAddress.'&UserAgent='.$UserAgent; $ch = curl_init(); // initialize the cURL curl_setopt($ch, CURLOPT_URL, "$URL"); // set URL and other appropriate options curl_setopt($ch, CURLOPT_HEADER, false); // do or do not return the header, usually false; otherwise returns the header to the browser curl_exec($ch); // grab URL and pass it to the browser curl_close($ch); // close cURL resource, and free up system resources ?>
Hopefully, one of the above workarounds will work for you. If no error is given and the content is simply blank, you probably cannot support that method. If there is an error and you cannot figure it out, please let me know, I will be happy to assist where possible.
| < Prev |
|---|







