I am new to Joomla and I am making a testing website to learn more.For the site I have created, I wish to create custom php scripts, that are to be called mainly from javascript elements inside the browser pages and return specific results according to user information.
So, for starters, I created a php script inside the Joomla site parent directory, and random prints worked. Then, I tried to make use of some of Joomla libraries' elements.
Despite my final aim,since I ran into problems, I tried to make something simple work, such as printing the site name:
<?php $config = JFactory::getConfig();
echo 'Site name is ' . $config->get( 'sitename' ); ?>
This is the error I get:
Fatal error: Class 'JFactory' not found in /home/ubuntu/workspace/JP-27/testphp.php on line 1
Generally, whenever I try to use any element of Joomla libraries, the elements are not found. Any advice?