Created
May 20, 2015 14:17
-
-
Save fidlerryan/d3ffceee60072ba8c999 to your computer and use it in GitHub Desktop.
PHP example for Accessing the Joomla Framework via an AJAX Call
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
if (empty($_POST["catid"])){ | |
$return["error"] = true; | |
$return["msg"] = "Unidentified category ID."; | |
} else { | |
$return["error"] = false; | |
$db->setQuery('SELECT title FROM #__categories WHERE id='.$_POST["catid"]); | |
$category = $db->loadRow(); | |
if (is_array($category)){ | |
if ($category[0] == "Portfolio"){ | |
$category[0] = "Project Study"; | |
} | |
$return["msg"] = $category[0]; | |
} | |
} | |
echo json_encode($return); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment