I’m sure this is a quickie. I have a PHP application I’m working on, and I’m designing the form validation/processing; the file will be called via AJAX.
My question is: when I call the form validation .PHP file via AJAX, will it have access to my previously declared .PHP includes?
For example, if I have a class User already included on the page calling the AJAX file, will I be able to call new User or User::authenticate inside my form validation .PHP?
Thanks.
Each invocation of php stands alone. It has no knowledge of what ran before it.
And it makes no difference that it’s ajax. ajax calls are identical to simply browsing to the page regularly. It’s just another way to display it in the browser, not another way to run php.