Processing some PHP after submitting a HTML form
-
Hi all,
What I’m trying to achieve is to run some PHP code after the user submits a HTML form. The PHP is to send the contents of the form to a specific database table, if that makes any difference ??
So I’ve tried so far to add the PHP as a template, but when setting the page to use that template it returns an error stating that the value entered for an integer (which is what the database is waiting for) is invalid, the value is blank as this all happens before the user gets a chance to enter the data into the form (or even see the form) as I’m guessing this php runs instantly when the page is loaded.
So instead I tried this: (the rest of the form is present, I just haven’t copied it in)
<form name="insert" action="/wp-content/themes/catch-evolution/db_send.php" method="POST" >
After submitting the form this says that “the requested URL *insert above path* can’t be found on this server”.
I’ve also tried it as
<form name="insert" action="db_send.php" method="POST" >
But this has the same result.
Does anybody know the best way to do this please? I’ve tried searching existing threads on here but can’t find an exact answer.
New to wordpress so please keep answers simple to understand ??
Thanks in advance,
azibux1
- The topic ‘Processing some PHP after submitting a HTML form’ is closed to new replies.