post() url problems with seperate folders
Hopefully this is an easy one. i have been beating myself up over this for a day now and it's time to asks the professionals. This is hard to explain but I will try my best. Please let me know if there are any questions.
Page making the call:
index.php (in root of web)
index.php link to js file with jquery code:
<script type="text/javascript" src="includes/User/register_script.js"></script>
I am trying to use the post function to post data to a php script in a different folder. Here is what my post call looks like (i stripped out the other code because it is not relevant for this):
$.post("/includes/User/function_register.php",{fname:$('#fname').val()},
This is not working with my url setup this way and function_register.php in that directory.
However, if I move function_register.php to the root of the web (where index.php is) and change my url to just function_register.php, it works flawlessly. This would be okay but I am going to have many php scripts like this and I want some kind of organization.