Hi
I need to put google maps inside my website so that the user can add his location (manually) Then the location will be stored in the database so I can brows it in the display page.I've looking over the web but couldn't find the way to do it :(
so if there is any tutorial on the web you can help me with I'd be thankful.

Dani AI

Generated

Short, practical plan that builds on ’s suggestion to read the docs and ’s marker example: render a Google map, let the user place or drag a marker, read the marker’s latitude/longitude, optionally reverse‑geocode to a readable address, then POST those coordinates to a PHP endpoint that saves them. The Maps JavaScript API (plus the Places/Geocoding services for search/reverse‑geocode) provide the client-side pieces you need. (developers.google.com)

Minimal implementation checklist (practical order): load the Maps JS API with your API key; create the map and either add a draggable marker or a click listener to drop one; on dragend or click read lat/lng and send them (fetch/XHR) to a PHP script; on the server use prepared statements and validate inputs before inserting. For storage use separate decimal columns (e.g. common pattern DECIMAL precision) or MySQL’s POINT spatial type if you plan spatial queries — add spatial indexes for large datasets. Always validate and parameterize on the server to avoid injection. (developers.google.com)

Operational notes you’ll hit in practice: Google Maps Platform requires an API key and a billing‑enabled Cloud project; create a key, enable only the APIs you use, and restrict the key by HTTP referrer for production. If the map is dark or watermarked “for development purposes only,” check the console for billing/key errors first. (developers.google.com)

Quick troubleshooting and alternatives: inspect the browser console for explicit Maps API errors (MissingKey/RefererNotAllowed/ApiNotActivated). If you want to avoid Google billing, consider Leaflet + OpenStreetMap for map tiles and a service like Nominatim (or a paid geocoding provider) for search/reverse geocoding. (developers.google.com)

Recommended Answers

All 2 Replies

I've never tried to pull that off, but I would think to start looking here. Eventually you'll find a term that repeats itself and you're ready to google what you actually need.

Sorry for not helping more, but I've never done it, so I don't really know where the info you need is. I'm basically sharing my way of starting to look for it xD

Hi,
Please try following link

It is very simple example with multiple markers.

Please check and let me know.
Thanks,
Ajay

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.