i am using a Form where i am having a textbox which on submit i am retriving the value of the text box and sending it to a file which gets the value and using it to fetch the records..
in my javascript i gave like
<script language="javascript" type="text/javascript">
function check()
{
var title=document.getElementById("title").value;
location.href="http://localhost/joomla/Joomla_1.5.7/testtest.php?title="+title;
}
</script>
And in the testtest.php file
i have
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<?php echo $_GET['title'];?>
<?php
$db =& JFactory::getDBO();
$keyword=$_GET['title'];
$query = 'SELECT * from #__chronoforms_UploadAuthor where text_6 like "%'.$keyword.'%"';
$db->setQuery($query);
$rows = $db->loadObjectList();
//echo $rows;
?>
but in this page its showing me as Restricted access .. Why so ?? And how to overcome this.. Please help me…
From the official doc:
When should it be used?
And that’s exactly what you’re doing: accessing the testtest.php directly.
You should either avoid that direct call or remove the check.
Most important, it seems you’re not applying the main guidelines when coding extensions for the Joomla framework. I strongly advise you to have a look to the documentation pages and, specifically, to the MVC pattern section.
SOURCE: http://docs.joomla.org/JEXEC