...

View Full Version : PHP,GeoIP and trying to pass a variable



FX77
01-29-2010, 10:49 AM
I have a dating site and my objective is to alter the landing page to show members from the visitors region. I've successfully installed GeoliteCity and currently able to echo a users "general" location on the homepage with this;


php echo $location;

I'm trying to insert "$location" into a script that calls profiles.


<h3 class="members">Members near <?php echo $location;?></h3>
<div class="block members">
{members:limit=10,profile_state=$location,cache_time=0}
</div>

As hard as I try, I've decided this isn't going to work. Apparently it has to do with passing a variable outside of PHP. I've also tried $SET_SESSION_ID and use that as a variable, which I haven't completely given up on.
Normally I'd rather take a beating than ask for help as there's a wealth of info available, but I'm just not sure of the best way to proceed or the proper search term to google. I'd be obliged by some thoughts on this.

mlseim
01-29-2010, 02:12 PM
Did you try this yet?

<h3 class="members">Members near <?=$location?></h3>
<div class="block members">
{members:limit=10,profile_state=<?=$location?>,cache_time=0}
</div>

The server should process the PHP first, before sending it to your browser,
but I'm not sure of when the {members: ... } part gets processed.
Doing the thing above is worth a try though.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum