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

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">

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.

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

<h3 class="members">Members near <?=$location?></h3>
<div class="block members">

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.