latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Clickbank: redirect for multiple products

Home Forums Community Forum Clickbank: redirect for multiple products

This topic contains 2 replies, has 2 voices. Last updated by  Jason Khoo 3 years, 8 months ago.

Topic Author Topic
Posted: Saturday Jan 19th, 2013 at 12:31 am #38297

Hi,

I have a few products in my clickbank account and I would like my affilate to choose whcih one they want to promote.

For example, if they wish to promote ‘everydayexcel_money__manager’, they would have to put the link as ‘http://AFFILIATE.imktgworks.hop.clickbank.net/?ppid=everydayexcel_MM’.

I modified the wp__redirect function publiched in one of the forum topics http://www.s2member.com/forums/topic/clickbank-button-hack-another-instalation-2/ to redirect the customer to the relevant url. If I got the logic right, it should go to http://www.excel-course.com/e-courses/hidden-secrets-in-data-analysis-with-excel-20072010/ first before it is redirected to http://www.advanced-excel.com/everydayexcel_money_manager.html.

Instead of redirecting the visitor to http://www.advanced-excel.com/everydayexcel_money_manager.html, the redirect returned the following error:

Warning: Cannot modify header information – headers already sent by (output started at /hermes/waloraweb039/b2033/pow.jksynergyworks/htdocs/excel-course/htdocs/wp-content/mu-plugins/s2-hacks.php:2) in /hermes/waloraweb039/b2033/pow.jksynergyworks/htdocs/excel-course/htdocs/wp-includes/pluggable.php on line 881

Could anyone help me? The modified codes for redirect is as follows:

<?php
add_action('init', 'handle_custom_clickbank_redirections');
function handle_custom_clickbank_redirections()
{
	if(isset($_GET['ppid']))
	{
		switch ($_GET['ppid']) {
			case 'hsdae':
				$clickbank_checkout = 'http://www.excel-course.com/e-courses/hidden-secrets-in-data-analysis-with-excel-20072010/';
				break;
			case 'everydayexcel_MM':
				$clickbank_checkout = 'http://www.advanced-excel.com/everydayexcel_money_manager.html';
				break;
			default:
				$clickbank_checkout = 'http://www.excel-course.com/';
		}
		
		wp_redirect($clickbank_checkout);
		exit;
	}
}

Appreciate if anyone could help me with this.

Thanks in advance for your help.

  • This topic was modified 3 years, 11 months ago by  Jason (Lead Developer). Reason: Moving to Community Forum for greater exposure. We can't assist with custom code that you write
  • This topic was modified 3 years, 4 months ago by  Jason Khoo.

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Wednesday Apr 10th, 2013 at 9:56 pm #47143
Daniel Vida
Username: micepace

This sounds to me like a PHP problem. What you are attempting to do is, when the page is opened, send a header telling the browser ‘This is the wrong document, you need to go *here*

The problem is, by the time you call the function, another part of the same page has already said ‘Ok, you have the right page, this is what format it’s in’... Headers enable a server to tell the browser things like: ‘404: I haven’t got that url’, or ‘500: There was a problem, but it was with the page, not the way you tried to access it’ without having to put that into the content of the document. Once the headers have been sent the browser treats everything else as part of the web page.

Basically, you either need to have that method run earlier, or use another method to direct that is part of the page content (like a javascript to redirect the browser)

Posted: Sunday Apr 28th, 2013 at 11:50 pm #48643

Daniel, thanks for your help.

Viewing 2 replies - 1 through 2 (of 2 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.