Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7598189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:20:48+00:00 2026-05-30T22:20:48+00:00

Ive been trying to solve some issues for implementing google maps with the api

  • 0

Ive been trying to solve some issues for implementing google maps with the api using this guidehttp://code.google.com/intl/no-NO/apis/maps/articles/phpsqlajax_v3.html.

Im stuck at this part: modifying the query with a variable set in another document or in the same document with processing of server basename like this:

*(this is the php file that generates the xml file:http://gmaps-samples-v3.googlecode.com/svn/trunk/articles/phpsqlajax/phpsqlajax_genxml3.php)*

$mapid = str_replace(".php","",basename($_SERVER['REQUEST_URI']));
$query = "SELECT * FROM markers WHERE type='".$mapid."'";

This doesnt work…

Also it doesn’t work if i set the variable in the main webpage.php file that displays the map eighter… it works if i set the variable in the same file (xmlgenerate.php) like this:

$mapid = "mymap";
$query = "SELECT * FROM markers WHERE type='".$mapid."'";

Hope someone can tell me what im doing wrong here.

edit: Heres a link to the live files btw. xmlgenerate=> http://www.pinnedmap.com/mapdata.php and mappage=> http://www.pinnedmap.com/test.php NB. a valid query example is: wondersoftheworld

to pass the variable from test.php would be ideal.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:20:50+00:00Added an answer on May 30, 2026 at 10:20 pm

    I don’t understand what you’re trying to do here:

    $mapid = str_replace(".php","",basename($_SERVER['REQUEST_URI']));
    

    Instead try this:

    $mapid = mysql_real_escape_string($_GET['mapid']);
    

    (The mysql_real_escape_string part prevents a SQL injection)

    Now just request your file like file.php?mapid=something and everything should work…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to solve this problem all day, and I've read some conflicting
Ive been tryin to solve this for a long time and now know why
I've been trying to solve this for ages (3 days) now and I just
I've been trying to solve this issue for a long time, and nothing seems
I've been trying to solve this problem for a number of days now but
I've been trying to solve this for a few hours now. I am compiling
I've been trying to solve this problem for a couple of hours but I
I've been trying to solve this and I found an equation that gives the
I'm trying to implement the simple-linkedinphp library (it's found at http://code.google.com/p/simple-linkedinphp/ ) It runs
I have been trying to write some code that asks the user for several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.