JQuery.Post calling php script gives 404 error

I'm using a Bitnami stack to develop a site using Joomla. I need to get Javascript to call a PHP routine to return data as below.

jQuery.ajax({
  type: "POST",
  url: "landing.php",
  data: rec_id,
  success: populateFields(landing),
  dataType: "json"
});

There are no syntax errors (I can get an alert from the "Success" code) and rec_id contains data, but the URL is generated as http://puter:81/joomla/index.php/landing.php  and the call fails with

"Failed to load resource: the server responded with a status of 404 (Not Found)". The PHP file is in the root folder (same as index.php); the port of 81 is required to distinguish the Joomla site from another on the same local machine.
Any ideas, please? I should add that I'm fairly new to javascript.
MikeDigginsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Try this
jQuery.ajax({
  type: "POST",
  url: "/landing.php", // FORCE SCRIPT TO ROOT
  data: rec_id,
  success: populateFields(landing),
  dataType: "json"
});

Open in new window

Question - are you sure this is correct
data: rec_id,

Open in new window

Did you not mean
data: {rec_id: rec_id},

Open in new window

Assuming your landing.php script is expecting  $_POST['rec_id']

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MikeDigginsAuthor Commented:
Thank you - on both counts. I was pretty sure I was missing something simple; sometimes you just don't know what you don't know :-)
Julian HansenCommented:
You are welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.