I'm trying to insert a $varable into code to retrieve data from mysql.
$location being the variable. I can echo $location onto the html page using this. Works ,no problem.PHP Code:include("./local/geoip/geoip.inc");
include("./local/geoip/geoipcity.inc");
include("./local/geoip/geoipregionvars.php");
$gi = geoip_open("./local/geoip/GeoLiteCity.dat", GEOIP_STANDARD);
$rsGeoData = geoip_record_by_addr($gi, $_SERVER ['REMOTE_ADDR']);
geoip_close($gi);
$location = $rsGeoData->region;
But I'm unable to make a query with this.HTML Code:<h3 class="members">Members near <?php echo $location;?></h3>
It would also help if I knew exactly what type of code/script this is.HTML Code:<div class="block members"> {members:limit=10,profile_state=<?php=$location;?>,cache_time=0} </div>
The <div class="block members"> is after the "echo" so I know the $location is getting there, just appears to be a problem with the way it's interepted. And/or the {} brackets around the code. If I manually edit the file, remove <?php=$location;?> and substitue it with a state value, it works.HTML Code:{members:limit=10,profile_state= ******, cache_time=0}
Any help here will most certainly be appreciated.



Reply With Quote



Bookmarks