Putting a self built form on a wordpress page
-
I have a unique html table with input fields that I need to place within a wordpress page.
This form needs to be able to submit data using php, to a mysql database. This database is separate from the WP install db, but is on the same server.
All the threads I’ve searched for about anything remotely related to this subject are outdated and reference using plugins that haven’t been updated in years/use solutions that may be outdated.
<?php $username="username"; $password="password";$database="database"; $field1-name=$_POST['Value1']; $field2-name=$_POST['Value2']; $field3-name=$_POST['Value3']; $field4-name=$_POST['Value4']; $field5-name=$_POST['Value5']; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "INSERT INTO tablename VALUES('','$field1-name','$field2-name', '$field3-name','$field4-name','$field5-name')";mysql_query($query);mysql_close(); ?>
<form method="post"> Value1: <input type="text" name="field1-name" /> Value2: <input type="text" name="field2-name" /> Value3: <input type="text" name="field3-name" /> Value4: <input type="text" name="field4-name" /> Value5: <input type="text" name="field5-name" /> <input type="Submit" /></form>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Putting a self built form on a wordpress page’ is closed to new replies.