Instantly share code, notes, and snippets.

View ajax-greeting.php
<?php
// Handle AJAX request
if( isset($_POST['value']) ){
// Storing the timezone offset from the jQuery code
$timezone_offset_minutes = $_POST['value'];
// Convert minutes to seconds
$timezone_name = timezone_name_from_abbr("", ($timezone_offset_minutes*60), false);
//JS code is needed to retrieve the user's timezone dynamically so we have it set statically for now