HTML form can't launch PHP file
-
Sorry if I am posting this in the wrong forum.
I have a feedback type form and a PHP file to send an email, but when I click the submit button on the form, I get an error that the php file can’t be opened. I tried opening it directly from my uploads folder and get the same error. I named the file suggestion-send.php. Created it with Notepad. I thought maybe that was the issue, so I copied a current PHP file, renamed it and pasted my text into it. Still won’t open. I am logged in with an administrator account. This is for a company intranet – not a blog.If you need the code it is:
FORM:
<form method=”post” name=”myemailform” action=”https://starthere.boselaw.com/wp-content/uploads/bme-items/suggestion-send.php”>
Enter Name: <input type=”text” name=”name”>
Enter Email Address: <input type=”text” name=”email”>
Enter Message: <textarea name=”message”></textarea>
<input type=”submit” value=”Send Form”>
</form>PHP:
<?php
$name = $_POST[‘name’];
$visitor_email = $_POST[’email’];
$message = $_POST[‘message’];
?>
<?php
$email_from = ‘[email protected]’;
$email_subject = “New Form submission”;
$email_body = “You have received a new message from the user $name.\n”.
“Here is the message:\n $message”.
?>
<?php
$to = “[email protected]”;
$headers = “From: $email_from \r\n”;
$headers .= “Reply-To: $visitor_email \r\n”;
mail($to,$email_subject,$email_body,$headers);
?>
- The topic ‘HTML form can't launch PHP file’ is closed to new replies.