PDA

View Full Version : Resolved trying to run php script with JS with SEF enabled



Ortix
02-02-2011, 09:24 PM
Hey guys, i'm trying to set up a favorite system for my website and I'm using ajax to do an async request to the server to run a php script.

The problem is that i'm running joomla with sef enabled. So whenever i'm on a page the URL looks like:

mysite.com/Category-Name/Item-Name/

when i click on the favorite button it will look like this

mysite.com/Category-Name/Item-Name/favorite.php?all-the-stuff-that-is-being-sent-to-the-file

This obviously doesn't work...

I followed this tutorial:
http://woork.blogspot.com/2007/10/insert-record-into-database-using-ajax.html

My question is how do i fix this.. can i get the base URL or something? I am a TOTAL noob to javascript. i somewhat understand it, but i have no clue what i'm doing. I just have basic programing knowledge through MATLAB and PHP...

BTW, the key here is not to leave the site :)

Thanks for the help in advance :D

EDIT

added my domain name in front of the location of the file and fixed the problem =)