Hi peeps,
I have an issue with my app.In particular i want to put some geocoding
but i cant have it work properly.I have a textarea for my search (i
use the element below)
________________________________________________________________________________
<div>
<?php echo ($form->create('Destination', array
('controller'=>'destinations','action' =>'search')));?>
<?php echo $form->input ('place', array('type' => 'text', 'label'=>
'Search Location:'));?>
<div align="center">
<?php echo ($form->submit('Search', array('div' => false,'class'
=> 'submitbutton'))); ?>
<?php echo($form->end()); ?>
</div>
</div>
________________________________________________________________________________
Now when the user put a destination i use httpSocket to hit a specific
url and take the results which is
http://ws.geonames.org/search?q=london&maxRows=10
The "q" is for destinations and the "maxRows" for the number of
results.
The problem i have is that i cant put in the "q" field the place that
user writes.
Any help would be appreciated!
Here is my httpSocket code:
__________________________________________________________________________
function search() {
$this->layout ='search';
App::import('Core', 'HttpSocket');
App::import('Xml');
$HttpSocket = new HttpSocket();
$results = $HttpSocket->get('http://ws.geonames.org/search?',
'q=barcelona&maxRows=10');
$parsed_xml =& new XML($results);
$parsed_xml = Set::reverse($parsed_xml);
$this->data['Destination']['place'] = $results;
//$this->Destination->save($this->data);
debug($results);
}
__________________________________________________________________________
P.S: I have put barcelona to see the results and it works fine!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---