Ecommerce Shopify WordPress Discussion

No response from PHP when using jQuery + AJAX

Been pulling my hair out with this one, I've got no idea why I'm not getting any response from my PHP file. The AJAX request is running the success function but with nothing coming back from PHP. JS jQuery('#submit').on('click', function(e){ var data = { email: jQuery('#email').val(), string: jQuery('#string').val(), }; jQuery.ajax({ url: '/wp-content/themes/suttons/parts/tankLookup.php', type: "POST", data: data, success: function(data){ console.log("yes"); console.log(data); }, error: function(){ console.log("no"); } }); }); PHP <?php $email = $_POST['email']; $string = $_REQUEST['string']; $return = array(); array_push($return, $email); array_push($return, $string); echo json_encode($return); ?> I've tried simpler code as well, down to just the basics in the PHP file and still a success but an empty response. <?php echo "true"; ?>
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.