i try to create sample Plugin
am using the Ajax to get the details from the database table
for example in the name.php page is located in the plugin/content/name.php
in same location another one file is marks.php this file need to connect the DB and and fetch records and displayed in the name.php file. By means of using the Ajax.
name.php
=======
Code: Select all
<div id ='laodingdiv'> </div><div id ='result_div'> resule will come here </div>
========
Code: Select all
....
...
.........
rollno = document.getElementById('rollno').value;
name = document.getElementById('name').value;
class = document.getElementById('class').value;
url = fullpath+"/marks.php?full_name="+name+"&class="+class +"&rollno="+rollno ;
ajaxcall(url,'laodingdiv','result_div');
=========
Code: Select all
if(method_exists($mainframe,'registerEvent')){
defined( '_JEXEC' ) or die( 'Restricted access' );
}else{
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
}
$database = &JFactory::getDBO();
// here need to connect db then fetch tbal result
$sql = "...............";
$row =...
echo $row; //this is the result i need to display inside the result div in the name .php
?>
i try to run the code but i got the result as " Restricted access ". int he name.php
how can i solve the problem how to get the results from the db and show in the result div ,by means of ajax.
i think my url formation is wrong how can i form the URL . how can i get and display the result
how can i form the URL how can i get the Details . please help me to solve this
thank you
Damodharan.k