Please Help me With Ajax in Joomla

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
damodharan_k
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Jul 20, 2009 5:59 am

Please Help me With Ajax in Joomla

Post by damodharan_k » Mon Jul 20, 2009 9:38 am

hi
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>

JS file :
========

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');

marks .php
=========

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
?>
My Question :

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

Locked

Return to “Extensions for Joomla! 1.5”