LisaM
02-04-2010, 01:39 PM
I'm trying to insert a $varable into code to retrieve data from mysql.
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;
$location being the variable. I can echo $location onto the html page using this. Works ,no problem.
<h3 class="members">Members near <?php echo $location;?></h3>
But I'm unable to make a query with this.
<div class="block members">
{members:limit=10,profile_state=<?php=$location;?>,cache_time=0}
</div>
It would also help if I knew exactly what type of code/script this is.
{members:limit=10,profile_state= ******, cache_time=0}
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.
Any help here will most certainly be appreciated.
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;
$location being the variable. I can echo $location onto the html page using this. Works ,no problem.
<h3 class="members">Members near <?php echo $location;?></h3>
But I'm unable to make a query with this.
<div class="block members">
{members:limit=10,profile_state=<?php=$location;?>,cache_time=0}
</div>
It would also help if I knew exactly what type of code/script this is.
{members:limit=10,profile_state= ******, cache_time=0}
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.
Any help here will most certainly be appreciated.