Thanks for any help ..this is the results.php file for the google api,
what I want to do is take these elements , which are passed to smarty and addslashes to the output.. After this is outputted to the browser, I want to insert this out put into the database..
$Element = $QueryResult[$i];
$Snippet[$i] = utf8_decode($Element ["snippet"]);
$URL[$i] = $Element["URL"];
$Title[$i] = utf8_decode($Element["title"]);
#############################
####resuslts.php
#############################
<?php
include_once('nusoap.php');
include_once('htmlfuncs.php');
include_once('background.php');
include_once('pagemenu.php');
include_once(SmartyClass());
function SearchResults()
{
//Create template object.
$ResultsTemplate = new Smarty;
$ResultsTemplate->compile_dir = FullSmartyCompileDir();
$Query = GetParam("Query", "");
if ($Query == "")
{
return;
}
$Site = GetParam("Site", "");
if ($Site != "")
{
$Site = " site:$Site";
}
$Start = intval(GetParam("Start", 0));
$GoogleKey = GoogleKey();
$GoogleAPIURL = GoogleAPIURL();
$MaxResults = MaxResults();
$Param = array("key" => $GoogleKey,
"q" => $Query.$Site,
"start" => $Start,
"maxResults" => $MaxResults,
"filter" => false,
"restrict" => "",
"safeSearch" => false,
"lr" => "lang_en",
"ie" => "",
"oe" => "");
// Create a new client by providing the endpoint to the constructor.
$Client = new soapclient($GoogleAPIURL);
$QueryResult = $Client->call("doGoogleSearch", $Param, "urn:GoogleSearch");
$Searchtime = $QueryResult["searchTime"];
$Begin = $Start + 1;
$End = $Start + $Param["maxResults"];
$Total = $QueryResult["estimatedTotalResultsCount"];
if ($Total > 0)
{
$QueryResult = $QueryResult["resultElements"];
for ($i = 0; $i < $MaxResults; $i++)
// must add slashes here
{
$Element = $QueryResult[$i];
$Snippet[$i] = utf8_decode($Element ["snippet"]);
$URL[$i] = $Element["URL"];
$Title[$i] = utf8_decode($Element["title"]);
}
$ResultsTemplate->Assign('Snippet', $Snippet);
$ResultsTemplate->Assign('URL', $URL);
$ResultsTemplate->Assign('Title', $Title);
$Result = $ResultsTemplate->fetch('results.tpl.htm') . PageMenu($Query, $Site, $Start, $Total, $MaxResults);
}
else
{
$Result = $ResultsTemplate->fetch('noresults.tpl.htm');
}
return $Result;
}
?>
###################################
results.tpl.htm file for smarty
###################################
{section name=i loop=$Title}
INSERT INTO home_loans ( title , description , base ) VALUES
('{$Title}',
'{$Snippet}',
'{$URL}');
{/section}
###################################
go give you an idea of what I am trying to do go here
http://usedcaralabama.com/google/index.php?Query=home%20loans
As you can see I want to cut and paste these directly into a phpmyadmin..
I am a beginner so please be patient..
God Bless