<head>
<title>OpenLayers Database Text Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.11/lib/OpenLayers.js"></script>
<style>
#mapdiv {
width:400px;
height:400px;
float:left;
}
</style>
</head>
<body>
<div id="mapdiv"></div>
<script>
map = new OpenLayers.Map("mapdiv");
map.addLayer(new OpenLayers.Layer.OSM());
var points = new OpenLayers.Layer.Text( "My Points",
{ location: "./db2text.php",
projection: map.displayProjection
});
map.addLayer(points);
var lonLat = new OpenLayers.LonLat( -0.1196, 51.5033 )
.transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
);
var zoom=15;
map.setCenter (lonLat, zoom);
</script>
</body>
</html>