PHP Form on Side Bar wont Submit?!?

What is confusing me is that in this HTML sidebar I add a PHP contact form and it wont submit. I am using a code that will be blocked when trying to send because it is requiring more fields but it never gets the chance to open the php file.

Here is the side bar:
[php]

Have a question?
			<textarea name="comment" id="comments" placeholder="Question"  width="90%"></textarea>
			<center>
            
            <input type="submit" name="submit" value="Send" id="submit" class="button darkblue"/></center>

		</form></div>[/php]

Here is the PHP:
[php]<?php

if(!$_POST) exit;

function tommus_email_validate($email) { return filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match(’/@.+./’, $email); }

$name = $_POST[‘name’]; $email = $_POST[‘email’]; $comments = $_POST[‘comments’];

if(trim($name) == ‘’) {
exit(‘

Attention! You must enter your name.
’);
} else if(trim($name) == ‘Name’) {
exit(‘
Attention! You must enter your name.
’);
} else if(trim($email) == ‘’) {
exit(‘
Attention! Please enter a valid email address.
’);
} else if(!tommus_email_validate($email)) {
exit(‘
Attention! You have entered an invalid e-mail address.
’);
} else if(trim($website) == ‘Website’) {
exit(‘
Attention! Please enter your website.
’);
} else if(trim($website) == ‘’) {
exit(‘
Attention! Please enter your website.
’);
} else if(trim($comments) == ‘Message’) {
exit(‘
Attention! Please enter your message.
’);
} else if(trim($comments) == ‘’) {
exit(‘
Attention! Please enter your message.
’);
} else if( strpos($comments, ‘href’) !== false ) {
exit(‘
Attention! Please leave links as plain text.
’);
} else if( strpos($comments, ‘[url’) !== false ) {
exit(‘
Attention! Please leave links as plain text.
’);
} if(get_magic_quotes_gpc()) { $comments = stripslashes($comments); }

//ENTER YOUR EMAIL ADDRESS HERE
$address = ‘@’;

$e_subject = 'You’ve been contacted by ’ . $name . ‘.’;
$e_body = “You have been contacted by $name with a budget of $website.” . “\r\n” . “\r\n”;
$e_content = “”$comments"" . “\r\n” . “\r\n”;
$e_reply = "Contact $name $last via, $email
";

$msg = wordwrap( $e_body . $e_content . $e_reply, 70 );

$headers = “From: $address” . “\r\n”;
$headers .= “Reply-To: $email” . “\r\n”;
$headers .= “MIME-Version: 1.0” . “\r\n”;
$headers .= “Content-type: text/plain; charset=utf-8” . “\r\n”;
$headers .= “Content-Transfer-Encoding: quoted-printable” . “\r\n”;

if(mail($address, $e_subject, $msg, $headers)) { echo “

Quote Sent Successfully.

Thank you $name, your quote has been submitted to us.

”; }[/php]

I would post a link to the site but I don’t want search engines picking up the link.

Are you sure about the spelling of “sendemail.php” and if it is in the same directory as the file with the sidebar?

Do you get any error messages? Is error reporting turned on?

Yes, the spelling is correct. I get no response from the button at all, while links do work in the same area.

Sponsor our Newsletter | Privacy Policy | Terms of Service