Google Maps API Integration : Radial Distance Calculation

I'm using the Google Maps API to display a map on a website I have to create for school. I plan on having a feature on my website that allows a user to make posts (similar to a blog), and tag the same with a location (similar to Instagram's feature of where they posted from), and have them stored on a server. When I choose a location from the Map, I want to be able to retrieve from the server and display all the posts that were posted within a 50 mile radius of the location chosen on map. I'm relatively new to web development and am not really sure how to implement this. Any assistance and guidance would be appreciated.