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

  • SEARCH
  • Home
  • 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 7623157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:38:13+00:00 2026-05-31T04:38:13+00:00

i’m here with a new problem,i want to echo the variable from php inside

  • 0

i’m here with a new problem,i want to echo the variable from php inside the content of infowindow,any suggestions?

Here is my code,Inside the infowindow content i have used some html code,that i have to replace with php variables.
for Eg:deviceid1 should be replaced with value from database

  var trieste = new google.maps.LatLng(45.6111555,13.8022614);
  var mapOptions = {
    zoom:      12,
    center:    trieste,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  var map = new google.maps.Map($("#map_canvas")[0], mapOptions);

  var places =
    [
      {
        "position": [45.6466883,13.7631226]
      },
      {
        "position": [45.6433281,13.7895584]
      },
      {
        "position": [45.6017884,13.6673355] 
      },
      {
        "position": [45.622442,13.7641525] 
      }
    ]

  var currentPlace = null;
  var icons=["green.png","red.png","blue.png","yellow.png"];
  var i=0;

    $(places).each(function() {
      var place = this;
      var marker = new google.maps.Marker({
        position: new google.maps.LatLng(place.position[0], place.position[1],place.position[2],place.position[3]),
        map     : map,
        icon    : icons[i]
      });

   if(i==0)
   {
   var infowindow = new google.maps.InfoWindow({
   content: '<ul><li>Device ID1</li><li>Device configuration1</li><li>Device Description1</li></ul><a href="riacqua/activepanel.php">Goto RIACQUA</a>'
     }); 
   google.maps.event.addListener(marker, 'mouseover', function() {
   infowindow.open(map, marker);
     });
    google.maps.event.addListener(marker, 'mouseout', function() {
   infowindow.close();
     });
    }
  • 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-31T04:38:14+00:00Added an answer on May 31, 2026 at 4:38 am

    Are you just trying to do something like thsi?

    var infowindow = new google.maps.InfoWindow({
       content: '<ul><li><?php echo $deviceId; ?></li><li>Device configuration1</li><li>Device Description1</li></ul><a href="riacqua/activepanel.php">Goto RIACQUA</a>'
         }); 
    

    That should do the trick, of course if your device id variable contains quotes/single quotes then you may have to strip them or escape them.

    This should work no problem with a php file, but you may need to change other settings if you are trying to get this to render in another file type (html, htm, etc).

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

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.