seran128 Posted December 5, 2006 Share Posted December 5, 2006 The code from phoogle says[code]$map->addAddress('210 Doster Ave, Mooresville, NC 28115',"<em>This is another address</em> that is italic");[/code]I want to add a description from my database to the end of my string that I am sending to googleMy Code[code]$description = "<br>Date:".$row["date"]."<br>Description:".$row["description"];echo $description;$map->addAddress("$row[address1],$row[city],$row[state] $row[zip],$description");[/code]The page returnsDate:12/8/06Description:Fri-Sat 8am-4pm Sun 1pm-4pm call for Directions 850-xxx-xxxxWarning: file_get_contents(http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&location=2712+Shoni+Dr%2CNavarre%2CFL+32566%2C%3Cbr%3EDate%3A12%2F8%2F06%3Cbr%3EDescription%3AFri-Sat+8am-4pm+Sun+1pm-4pm+call+for+Directions+850-396-5898) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home/mysite/public_html/phoogle.php on line 129 Quote Link to comment Share on other sites More sharing options...
Psycho Posted December 5, 2006 Share Posted December 5, 2006 The problem is in your call here:[code]$map->addAddress("$row[address1],$row[city],$row[state] $row[zip],$description");[/code]It takes TWO values, but you have everything enclosed in double quotes so it is interpreted as a single value. You can verify that by looking at the location value in the query string of the error message. Try this:[code]$map->addAddress("$row[address1],$row[city],$row[state] $row[zip]",$description);[/code] Quote Link to comment Share on other sites More sharing options...
seran128 Posted December 5, 2006 Author Share Posted December 5, 2006 Thanks! it now makes sense Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.