Triggering form action on same page with the plugin insert php code snippet
-
Hello there, so I’ve the following problems:
I’m coding a php shopping cart and currently using a theme that does not support custom page templates so I have to use the plugin ” insert php code snippet ” which works fine, I just insert my code there and copy->paste the shortcode in my page.
All good so far but here comes the problem:
In order to add products to the cart my form action triggers the following code:<form method="post" action="CartDisplay.php?action=add&code=<?php echo $product_array[$key]["code"]; ?>"> </form>This works perfectly on my local server however here it cant target the ” CartDisplay.php ” file because it isn’t on the server of my website and I’m currently using a plugin to add the php code. When I upload it on the server it still won’t get recognized. ( Maybe I fail at pathing correctly? )
So, when I click the button ” Add to cart ” I get redirected to a 404 page, even though I’m not using any reserved keywords by wordpress like “name”. I’ve them all with a prefix.
If you need more of my code I’d be glad to share it, just didn’t want to make this post look too big and messy.
Any ideas? I’d really appreciate your help. Have a good day folks.
The topic ‘Triggering form action on same page with the plugin insert php code snippet’ is closed to new replies.