• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AJAX request path

#1
[eluser]ptvw2011[/eluser]
I am using some AJAX in my Code Igniter application but it only seems to work when the PHP file which is carrying out some processing is referred to absolutely.

I want to use a relative path as I don't want to change individual URL s when migrating from my local server.

Code:
new Ajax.Request("http://localhost/pth/to/my/php/file",
        {
          method: 'post',
          postBody: 'name='+ $F('name'),
          onComplete: showResponse
        });
}

At present I have the PHP file saved in a folder located in the Code Igniter root which is the same place as this JavaScript file.

Where is the best place to save the PHP file and how would I refer to it relatively in Code Igniter?

I've tried using '/filename.php' which I suppose should work as its in the same directory as this JavaScript file.

Thanks

me


Messages In This Thread
AJAX request path - by El Forum - 04-15-2011, 02:40 AM
AJAX request path - by El Forum - 04-15-2011, 06:57 AM
AJAX request path - by El Forum - 04-15-2011, 07:29 AM
AJAX request path - by El Forum - 04-15-2011, 07:54 AM
AJAX request path - by El Forum - 04-15-2011, 07:55 AM
AJAX request path - by El Forum - 04-15-2011, 08:03 AM
AJAX request path - by El Forum - 04-15-2011, 09:41 AM
AJAX request path - by El Forum - 04-15-2011, 02:09 PM
AJAX request path - by El Forum - 04-15-2011, 03:24 PM
AJAX request path - by El Forum - 04-16-2011, 10:13 AM
AJAX request path - by El Forum - 04-18-2011, 10:03 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.