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 />';
}
}
?>