Hi Everybody, Happy New Year and all that!
I am having the same problem in WordPress. Here is my form code. The form is just one <div> from the home page. The file is saved as .php
<div class=”form”>
<form name=”newsletterform” method=”post” action=”process.php”>
<table>
<tr>
<td><label name=”name”>Name:</label></td>
<td><input type=”text” name=”name” maxlength=”45″ maxsize=”30″ /></td>
</tr>
<tr>
<td><label for email=”email” id=”email” name=”email”>Email*:</label></td>
<td><input type=”text” name=”email” maxlength = “45” maxsize=”30″ /></td>
</tr>
<tr>
<td><input type=”reset” name=”reset” value=”Reset” /></td>
<td><input type=”submit” name=”submit” value=”Submit” /></td>
</tr>
</table>
</form>
</div><!– form div ends here –> `
This file is saved to my theme Twentythirteen folder. I have also created a process.php file and saved that there also. Problem is that I am getting this error when I submit the form. Here is the process.php page.
<?php /* Template Name: process.php */ ?>
<?php
if(isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$server = mysqli_connect('localhost', 'root', '', 'saint_stanislaus') or die("The Server Cannot Be Reached at this Time!");
//$dbc = mysqli_select_db($server, 'newsletter') or die("There is a problem accessing the databse!");
$query = mysqli_query($server, "INSERT INTO subscribers (name, email) VALUES('$name','$email')");
$name = strip_tags($name);
$email = strip_tags($email);
if(empty($name) || empty($email)) {
echo "All Fields Must Be Filled In!";
} else {
echo "You have been successfully subscribed";
}
}
mysqli_close($server);
?>
I have created a page in my admin area called process and instead of using the default I use the template page /*Template Name: process.php*/
But all I get is this error.
Not Found
The requested URL /saint_stanislaus/process.php was not found on this server.
Any Suggestions?