Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Thanked 0 Times in 0 Posts

    PHP,GeoIP and trying to pass a variable

    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 Code:
    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.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Cottage Grove, Minnesota
    Thanked 1,096 Times in 1,087 Posts
    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.


    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts