How do I make form action attribute go to themes function.php
-
Hi, I’m having issues running some code in my wordpress website’s theme functions.php.
I created a page which has a form, and the action attribute of the form is supposed to submit the data to the themes functions.php
On submit of the form, the page redirects to the functions.php file but does not do anything.
Here is the code for the form
<div> <form name="formSenda" method="POST" action="../wp-content/themes/storefront/functions.php"> <input type="text" placeholder="name" id="nameSenda" name="nameSenda"> <input type="email" placeholder="emailSenda" id="emailSenda" name="emailSenda"> <input type="submit" value="Check" name="submitSenda"> </form> </div>
Here is the code in functions.php
function inSenda(&$na,&$em){ $message = "Hi $na, is your email $em?"; $headers = "From Fly Gadgets \r\n"; mail($em, "Invoice", $message, $headers); echo "<script type='text/javascript'> document.location = 'categories'; </script>"; }; $nameSenda = $_POST['nameSenda']; $emailSenda = $_POST['emailSenda']; if(!empty($nameSenda) && !empty($emailSenda)){ inSenda($nameSenda, $emailSenda); }
Thanks for your time.
The page I need help with: [log in to see the link]
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘How do I make form action attribute go to themes function.php’ is closed to new replies.