Created
January 30, 2014 15:24
-
-
Save thomasgriffin/8710900 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.getJSON('http://freegeoip.net/json/', function(location) { | |
var d = new Date(), | |
curr_date = d.getDate(), | |
curr_month = d.getMonth(), | |
curr_year = d.getFullYear(), | |
fulldate = curr_date + "-" + curr_month + "-" + curr_year; | |
$('<input id="date" type="hidden" name="custom_date" value="' + full_date + '" />').appendTo($('#your-form-id-here')); | |
$('<input id="ip" type="hidden" name="custom_ip" value="' + location.ip + '" />').appendTo($('#your-form-id-here')); | |
$('<input id="country" type="hidden" name="custom_country" value="' + location.country_name + '" />').appendTo($('#your-form-id-here')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment