title: Google map markers in php code
body: <p>I have a code which should take the input of latitude and longitude from the user and display the location of the user. Well, the map is getting displayed, but the marker is not getting displayed. Please help...</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Map&lt;/title&gt;
  &lt;script type='text/javascript'
  src='https://maps.googleapis.com/maps/api/js?key=AIzaSyDFLaJwxTIGpZmwfpbEyOU5XZglUq6-5iM&amp;sensor=false'&gt;
  &lt;/script&gt;
  
  &lt;?php
  $lat= $_POST['lat'];
  $long= $_POST['long'];
  ?&gt;
  
  &lt;script type='text/javascript'&gt;
      var latitude = "&lt;?php echo $lat; ?&gt;";
      var longitude ="&lt;?php echo $long; ?&gt;";
  function initialize()
  {
      var myLatLng = new google.maps.LatLng(latitude,longitude);
  
   var mapProp = {
    zoom:8,
    center: myLatLng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
    };
  var map=new google.maps.Map(document.getElementById('map_canvas'),mapProp);
  
  var marker = new google.maps.Marker({
    position: myLatlng,
    map: map,
    optimized: false,
    title:'Former About.com Headquarters'
  }); 
  }
  
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload='initialize()'&gt;
  
  &lt;div id='map_canvas' style='width:300px; height:300px;'&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>