Sublime directory Surf the web anonymous Pagerank Monitor


clickbank search engine help needed

askhow
Mon 21 April 2008, 03:19 pm GMT +0200
Greetings. I have installed the ClickBank Contextual because I really want to create a clickbank search engine on my site askhow.com - ie, all results are clickbank products from search. I read an article said you could do it w/this script:

Here's the article

http://paymentblogger.com/2007/06/19/how-to-create-your-own-clickbank-search-engine/

I downloaded the example file and am having initial trouble with the form to show up correctly.

I haven't change anything, except updated the info required.

Any help would be great because I am losing traffic as we speak, thanks

Lisa

Nikolas
Mon 21 April 2008, 04:59 pm GMT +0200
Hi.

First of all do you have the clickbank contextual script installed in your server?

askhow
Mon 21 April 2008, 05:21 pm GMT +0200
Yes, at the root directory (public_html)

thanks

Nikolas
Mon 21 April 2008, 06:59 pm GMT +0200
ok, and what is the error that you get?

askhow
Mon 21 April 2008, 08:18 pm GMT +0200
basically, if you look at www.askhow.com you can see i get the form info and no search box,

thanks

Nikolas
Mon 21 April 2008, 08:32 pm GMT +0200
Yes that's because you are not writing the html code correct. Instead of <> you have &qlt;....

askhow
Mon 21 April 2008, 08:59 pm GMT +0200
ok let me look, i took it from the example in the article linked above, (downloadable zip)

It's funny the code doesn't have that in it: here's the code:(i changed the user and pass but that's it)
I usually work with html, so I'm not certain what i need to do to make the php form work.

thanks for taking a look.
Code starts here:
<?php
/**
 * PHP function for integration of search results with Clickbank program
 *
 * Requires : Clickbank contextual script
 * http://cbcontextual.com/
 *
 * For support issues please refer to the webdigity forums :
 * www.webdigity.com
 *
 * If you like this script please give us some link love :)
 * paymentblogger.com
 *
 * ==============================================================================
 *
 * @version $Id: Clickbank Search Engine ,v 1 2007/06/19 17:00:32 $
 * @copyright Copyright (c) 2007 Payment Blogger (http://paymentblogger.com)
 * @author Nick Papanotas <nikolas@webdigity.com>
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
 *
 * ==============================================================================
 */

//Settings :
$uname = 'notrealname';//Username in your CBcontextual installation
$pass  = 'notrealpass';//Password in your CBcontextual installation
$instURL = 'http://www.askhow.com';//The url path to your CBcontextual installation. No trail slash
$limit = 15;//How many results to display

echo htmlspecialchars('<form method="post" action="'.$_SERVER['PHP_SELF'].'" >
<input type="text" name="q" value="'.$_POST['q'].'" /> <input type="submit" value="Search" />
</form>');

if ( !empty($_POST['q'])){
  $results = unserialize(file_get_contents($instURL.'/api.php?uname='.$uname.'&pass='.$pass.'&nr='.$limit.'&type=php&keywords='.$_POST['q']));
  if ( !$results )
  echo 'No results. Please search again.';
  else{
    foreach ( $results as $res )
    echo '<a href="'.$instURL.'/clk.php?i='.$res['id'].'">'.$res['title'].'</a><br />'.$res['description'].'<br />';
  }
}

?>

askhow
Mon 21 April 2008, 11:39 pm GMT +0200
Ok, I just wanted to show you that the clickbank contextual script is working, but I can't get the search engine, scroll down and you'll see the form mess up, thanks again for your help

Nikolas
Tue 22 April 2008, 12:29 pm GMT +0200
Replace this:

echo htmlspecialchars('<form method="post" action="'.$_SERVER['PHP_SELF'].'" >
   <input type="text" name="q" value="'
.$_POST['q'].'" /> <input type="submit" value="Search" />
</form>'
);
?>


with this:

echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'" >
   <input type="text" name="q" value="'
.$_POST['q'].'" /> <input type="submit" value="Search" />
</form>'
;
?>

askhow
Tue 22 April 2008, 01:01 pm GMT +0200
Thanks, I get the search box now (at the bottom of the page) but each time I type in a search I get this error:

Warning: file_get_contents(http://www.askhow.com/api.php?uname=askhow&pass=lulub3&nr=15&type=php&keywords=how to) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home/askhow/public_html/index.php on line 53
No results. Please search again.

Here is what is on line 53 in my code:
$results = unserialize(file_get_contents($instURL.'/api.php?uname='.$uname.'&pass='.$pass.'&nr='.$limit.'&type=php&keywords='.$_POST['q']));

Thanks again for your time,

Lisa

Nikolas
Tue 22 April 2008, 01:29 pm GMT +0200
Change the $instURL directive to where you have installed the CBCS (eg. $instURL = 'http://www.askhow.com/cb';)

askhow
Tue 22 April 2008, 01:34 pm GMT +0200
ok i did that and nothing changed, likely because it is installed not in a folder but at the public_html so there is no cb folder. once I typed in 'test' and got a bunch of random results but otherwise i have this error above,

thanks

askhow
Tue 22 April 2008, 03:35 pm GMT +0200
Here is something that may be helpful.  I set it back to the way is was, ie, w/o the cb at the end and here is the deal. It works if there are no spaces in the search so if i type in How_to_draw, it works but if i type in how to draw it doesn't. What can i do?

Assuming the string breaking with a space gets fixed, I'm perplexed by results. If you type in bike, then a good result come in. If  you type in how_to_ride_a_bike then it is whack. The best results seem to come from organic_gardening.

I'm really hoping this can work.

thanks,

Lisa

Nikolas
Wed 23 April 2008, 09:29 am GMT +0200
Ok, now change this line :

unserialize(file_get_contents($instURL.'/api.php?uname='.$uname.'&pass='.$pass.'&nr='.$limit.'&type=php&keywords='.$_POST['q']));?>

to this:

unserialize(file_get_contents($instURL.'/api.php?uname='.$uname.'&pass='.$pass.'&nr='.$limit.'&type=php&keywords='.urlencode($_POST['q'])));?>

askhow
Wed 23 April 2008, 01:36 pm GMT +0200
ok, it seems to be working, from a form stand point.. is there any way to get better results? ie, the how to ride a bike gets strange results but ride bike gets a real one?

thanks

Nikolas
Wed 30 April 2008, 07:38 am GMT +0200
I don't think this is possible at the moment. You should probably contact the owners of the script for this (I no longer own the clickbank contextual script)

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional