I've searched through a number of support forums and I still can't find the answer I'm looking for. Essentially, I have a user registration form on my website. When the user clicks "submit" it saves their data in a mySQL database and redirects them to another page. Simple enough.
But I want to have another page that has a map with a marker for each registered users' approximate location (city, state, country).
This isn't too hard to do if users were required to input their own lattitude and longitude. But who has that information readily available???
When the user clicks "submit" three input fields are combined into one variable ($address). How can I geocode that variable ($address), and have it output to two other variables ($lat and $lng)??? Looking to do this BEFORE mysql_connect, that way I have everything ready to insert into mySQL database table.
$first_name=$_POST['first_name'];
$last_name=$_POST['last_name'];
$status=$_POST['status'];
$service=$_POST['service'];
$rank=$_POST['rank'];
$specialty=$_POST['specialty'];
$address=$_POST['city'] . ',' . $_POST['state'] . ',' . $_POST['country'];
$city=$_POST['city'];
$state=$_POST['state'];
$country=$_POST['country'];
$email=$_POST['email'];
mysql_connect($host,$username,$password) or die("Unable to connect to database");
@mysql_select_db($database) or die("Unable to select database");
$query = "INSERT INTO $table VALUES ('','$first_name','$last_name','$status','$service','$rank','$speciality','$address','$city','$state','$country','','','$email')";
mysql_query($query);
Any help would be MUCH appreciated!!! Running with PHP and mySQL.