Link to home
Start Free TrialLog in
Avatar of Arka3L
Arka3LFlag for United States of America

asked on

_POST not posting to my variables

Guys,

I don't understand whats wrong here, this is almost a complete copy from an original working form i had before and this thing is shooting me emails with my message but not including the values for my fields. For example it's giving me Name: .... Email: ..... Comments: .....

This is my HTML Form, and everything works fine:

 
<form id="contacts" method="post" enctype="multipart/form-data" action="include/inc_sendmail.php">

                            <input tabindex="1" type="text" id="visitor" name="name" value="Name" onfocus="if (this.value=='Name') this.value='';" onblur="if (this.value=='') this.value='Name';" class="required name" minlength="5" />
                          <br />
                                
                                <input tabindex="2" type="text" id="visitormail" name="email" value="E-mail" onfocus="if (this.value=='E-mail') this.value='';" onblur="if (this.value=='') this.value='E-mail';" class="required email" />
                                <br />

                                
                                <textarea tabindex="3" id="notes" name="comment" cols="30" rows="3" onfocus="if (this.value=='Message') this.value='';" onblur="if (this.value=='') this.value='Message';" class="required" minlength="10">Message</textarea>
                                <br />

                            	<input class="button" name="Send" value="Send e-mail" type="submit" />
                            	
                        	</fieldset>
                        </form>

Open in new window



Here is my "working" php file:


 
<?php

ini_set("sendmail_from", "xxxxx@gmail.com");


$name = $_POST['visitor'];
$email = $_POST['visitormail'];
$comment = $_POST['notes'];
$from = $email;

$message = "Name: $name \n\n Email: $email \n\n Comments: $comment\n\n";



if (!@mail("xxxxx@gmail.com","Portfolio Contact", $message,"From: $from\nContent-Type: text/html; charset=iso-8859-1")) {
	echo "<script language='javascript'>alert('There have been some problems sending the email');</script>"
	."<meta http-equiv='refresh' content='0;url=../index.html'>";
	
} else {
	echo "<script language='javascript'>alert('Thank you for contacting me');</script>"
	."<meta http-equiv='refresh' content='0;url=../index.html'>";
}
?>

Open in new window



Anyone see anything obvious i'm missing here?
ASKER CERTIFIED SOLUTION
Avatar of IngCharlie
IngCharlie
Flag of Slovakia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Arka3L

ASKER

Interesting, i had no idea! That fixed it.

thanks again for the prompt answer :D