Skip to content
Advertisement

Tag: form-data

How to pass an image file thru jquery $.ajax() correctly?

I am trying to upload an image and passing the userID and file through ajax to the PHP file profileSettings.inc.php. However it succeed in running the php file, but the data was not passed through. When I ran print_r($_POST);, in the php file it returned an empty array. Form: profileSettings.inc.php: ?> Anyone knows what I am doing wrong in passing

Avoid Laravel redirect after validation

I’m making a simple validation on my Laravel controller: My problem is that this validation redirects me to the home if fails, and i’m making the request via AJAX, i know that Laravel detects when a request is via Ajax, but it only works if is a normal request (the typical request in which i send the headers with Content

Advertisement