Welcome Guest, Not a member yet? Register   Sign In
Problem with CJAX
#11

[eluser]TheFuzzy0ne[/eluser]
I've only studied the documents for it, and I learnt from there. Once you understand the basic concept, it's surprisingly easy and powerful.

Google is your friend. What is it you're trying to achieve?
#12

[eluser]RaGe10940[/eluser]
Something like this:

http://cjax.sourceforge.net/examples/confirm_action.php

and also need to have one of my tables automatically refresh upon insert.
#13

[eluser]Ajaxboy[/eluser]
Hello there, sorry you are having issue installing Cjax. It is very important to understand that there are two different distributions of Cjax, and only one of these is for CodeIgniter. The installation instructions you are following aren't the codeignater one's. There used to be a a wiki here on this site with full instructions with links and documentation unfortunately all these docs were moved and it is now a little more difficult to locate them, everything was moved over to github. Here is a link of the instructions for codeigniter: https://github.com/EllisLab/CodeIgniter/...odeIgniter

Please let me if you run into any issue while following the correct documentation.
#14

[eluser]RaGe10940[/eluser]
Hey Ajaxboy thanks a lot, I really appreciate developers that still continue to support their projects via updates and community support as well!

I wanted to know if all the files have to be in the same directory?

My web root : is public

my application and system are located a above. I have edited the ajax.php to enter in the correct system and controller path but I do not think it had the correct outcome.

My folder structures :

/Test
ci/
application/
system/
public/ <- - - -- - - - Web Site root (here is like all the js files, my pictures and styling)


Reason why I ask is that for security reasons I thought that most if not all php scripts should be above the web site root.

Any solutions to this?

Just to clarify :

I do not need to use the AjaxController that is included?



#15

[eluser]Ajaxboy[/eluser]
cjax should go located as follows:



/Test
ci/
application/
system/
cjax/
ajaxfw.php
ajax.php
public/ <- - -—

Cjax does not make use of the public directory, though some files are accessible through the browser such as the JavaScript library and the css, each directory in cjax/ has it's own .htaccess file to restrict or allow access. ajax.php is the equivalent to index.php in your root directory, ajax.php is used as gateway to access the libraries/php files included but the files themselves aren't executable alone, everything goes through ajax.php.

The ajax controller included in the controller directory is used by ajax.php, (you don't need to mess with it). It is the way Cjax integrates into CodeIgater and inherit all it properties.
#16

[eluser]RaGe10940[/eluser]
Cannot find the correct path to Js directory

Folder structure as follows :

Test/
ci/
application/
system/
cjax/
ajaxfw.php
public/
ajax.php

I had to change the application path and system paths in ajax.php and then I had to change the path in the ajaxcontroller.php to currect where ajaxfw.php

I then just copied and pasted the response folder with the CJAX controllers into the application folder and that went fine. Now I get the

Cannot find the correct path to Js directory


#17

[eluser]Ajaxboy[/eluser]
Yes in VERY rare situation you would get this, has happened only once to another person. The quick way around is by using the config file. There is a config.default.php file included in cjax/ directory. rename that to config.php. There is a setting called "init_url", if you specify the url here it will take care of the issue.
#18

[eluser]RaGe10940[/eluser]
$config->init_url = 'https://www.finaidtest.com/ajax.php?';

and still i keep getting the error.

Again my folder structure is :


Test/
ci/
application/
system/
cjax/
ajaxfw.php

public/
ajax.php
could that be affecting the outcome? when I had ajax.php in the ci/ folder i couldn't even get anything to show. i would get a 404. so i kinda have to have ajax.php in the public/ folder.
#19

[eluser]Ajaxboy[/eluser]
Would be:

$config->init_url = ‘https://www.finaidtest.com/’;


If you don't get anything to show it is likely a htaccess/mod-rewrite issue, look into that. It should at least show an error if nothing else. Be sure to restore the files location where they were, since it is not designed to be on the public directory it will probably cause issues. ajax.php and ajaxfw.php should be in the same directory where index.php is.
#20

[eluser]RaGe10940[/eluser]
Followed your steps

and still getting the error

My folder structure is as follows :

Test/
ci/
application/
controllers/
AjaxController
Response/
Test
views/
Test
system/
cjax/
public/ < - - - Website root
ajax.php
Ajaxfw.php
index.php

The problem seems to be generated here :


Code:
if(!$js_dir = $ajax->config->js_path) {
   if(@is_dir('cjax/')) {
    $js_dir  = "cjax/core/js/";
   } else if(@is_dir('core/js/')) {
    $js_dir  = "core/js/";
   } else if(@is_dir('../cjax')) {
    $js_dir  = "../cjax/core/js/";
   } else if(@is_dir('../../cjax')) {
    $js_dir  = "../../cjax/core/js/";
   } else if(@is_dir('../../../cjax')) {
    $js_dir  = "../../../cjax/core/js/";
   } else {
    die("Cannot find the correct path to Js directory.");
   }
  
   $error = error_get_last();
  
   if($error &&  preg_match('%.*(open_basedir).*File\(([^\)]+)%', $error['message'], $match)) {
    die( sprintf('Restriction <b>open_basedir</b> is turned on. File or directory %s will not be accessible while this setting is on due to security directory range.', $match[2]) );
   }
  }


I tried the init_url and changed the name, still got the error, so i just reverted the back to the default names and values.

Any other tips for me? - sorry for being a pain.




Theme © iAndrew 2016 - Forum software by © MyBB