Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 03-21-2004, 02:20 PM   #1 (permalink)
Senior Member
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 1,757
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
Next, previous, 1,2 links etc. for my Google SE

As part of my search engine I want to have next, previous and 1,2,3 up to 10 links which change based on search results etc. (like Google has)

Basically the current php looks like this

[code:1:bbbb50225d]
<?php
// include the class
include("nusoap.php");

# Create a new SOAP client, feeding it GoogleSearch.wsdl on Google's site
$soapclient = new soapclient('http://api.google.com/GoogleSearch.wsdl', 'wsdl');

// uncomment the next line to see debug messages
// $soapclient->debug_flag = 1;

// set up an array containing input parameters to be
// passed to the remote procedure
$params = array(
'key' => '-mygooglelicensekey-', // Google license key
'q' => $_GET['q'], // search term
'start' => 0, // start from result n
'maxResults' => 10, // show a total of n results
'filter' => true, // remove similar results
'restrict' => $_POST['restrict'], // restrict by topic
'safeSearch' => true, // remove adult links
'lr' => 'lang_en', // restrict by language
'ie' => '', // input encoding
'oe' => '' // output encoding
);

// invoke the method on the server
$result = $soapclient->call("doGoogleSearch", $params, "urn:GoogleSearch", "urn:GoogleSearch");

// print the results of the search
// if error, show error
if ($result['faultstring'])
{
?>
</p>
<? echo $result['faultstring'];?>
<?
}
else
{
// else show list of matches with links
?>
<p align="justify">Your search for <strong>
<?=$result['searchQuery']?>
</strong> produced
<?=$result['estimatedTotalResultsCount']?>
results. </p>
<?
if (is_array($result['resultElements']))
{
foreach ($result['resultElements'] as $r)
{
echo "<a href=" . $r['URL'] . ">" . $r['title'] . "</a>";
echo "<br />";
echo $r['snippet'] . "";
echo "<br />";
echo $r['URL'] . " - " . $r['cachedSize'] . " - ";
echo "<a href=retrieve.php?u=" . $r['URL'] . ">Cached</a>";
echo "<p>";
}
}
}
?>
[/code:1:bbbb50225d]

Basically you can only do one query at a time which involves 10 results, so I need links at the bottom to change this

[code:1:bbbb50225d]
'start' => 0, // start from result n
[/code:1:bbbb50225d]

to

[code:1:bbbb50225d]
'start' => 11, // start from result n
[/code:1:bbbb50225d]

etc. for each page
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-21-2004, 03:21 PM   #2 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,504
iTrader: 0 / 0%
kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
this is kinda like it..
http://www.thespear.net/php/tutorials/Pages/
__________________
http://www.kylevarga.com - My blog.
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google AdSense: Text links / Image links sniperhiga Google Forum 8 07-25-2007 10:59 AM
previous / next page link in WP. DarrenC Blogging Forum 3 07-08-2006 02:24 AM
Chache has changed to the previous Runilo Google Forum 1 08-16-2004 07:47 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 09:08 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.