php - change on the url latitude and longitude

385

i have one URL:- Link
i want to change there lat and lng value
i have one code to get region name and latitude and longitude value from IP address
this is my code:-

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <link rel="stylesheet" href="index.css">
        <script type="text/javascript" src="http://j.maxmind.com/app/geoip.js" ></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <script>
                function load(){
                var region= geoip_city();
                var lan=geoip_latitude();
                var lng=geoip_longitude()
                    $('div').html(region)
                    alert(lan);
                    alert(lng);
                    }
        </script>
    <body onload="load()">
        <div></div>
    </body>
    </head>
</html>


with this code i have alert one latitude and longitude value.
i want to change on my given url link with this lat and lng value.

649

Answer

Solution:

You can redirect to your webpage using javascript.

window.location.replace('http://services.gisgraphy.com/geoloc/search?lat='+lan+'&lng='+lng+'&radius=7000');

or:

window.location.href = 'http://services.gisgraphy.com/geoloc/search?lat='+lan+'&lng='+lng+'&radius=7000';

Update:

Or, like Amit says, do an AJAX call with that vars

People are also looking for solutions to the problem: php - OpenEMR and HL7

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.