Perdon por el doble post pero no me cupo todo el codigo xD
el send.php
Código PHP:
<?php
//Prefedined Variables
$to = "[email protected]";
$subject = "Contact from your website.";
if($_POST) {
// Collect POST data from form
$name = stripslashes($_POST['name']);
$email = stripslashes($_POST['email']);
$comment = stripslashes($_POST['comment']);
// Define email variables
$message = date('d/m/Y')."\n" . $name . " (" . $email . ") sent the following comment:\n" . $comment;
$headers = 'From: '.$email.'\r\n\'Reply-To: ' . $email . '\r\n\'X-Mailer: PHP/' . phpversion();
//Validate
$header_injections = preg_match("(\r|\n)(to:|from:|cc:|bcc:)", $comment);
if( ! empty($name) && ! empty($email) && ! empty($comment) && ! $header_injections ) {
if( mail($to, $subject, $message, $headers) ) {
return true;
}
else {
return false;
}
}
else {
return false;
}
}
?>
y dejo el CSS por si hace falta
CSS
Código CSS:
Ver original/* CSS Document */
body {
margin:0px;
padding: 0px;
}
#wrapper {
width: 100%;
margin-top: 0px;
margin:auto;
background: url(Images/bgwrap.jpg);
}
#header_wrap{
position: relative;
width: 100%;
height:200px;
margin:auto;
background-image: url(Images/bkgd.png);
background-repeat: repeat-x;
background-position:center center;
}
#header{
width:1100px;
height:200px;
margin:auto;
background-image: url(Images/alexei.png);
background-repeat: no-repeat;
background-position: center center;
}
#main {
width:1100px;
margin:auto;
overflow:hidden;
clear:none;
}
#portfolio{
width:1000px;
height:650px;
margin:auto;
}
#quotes{
height:350px;
width:1100px;
margin:auto;
}
#intro {
width:1100px;
height:25px;
}
#quote1{
float:left;
width:300px;
height:300px;
margin-bottom:25px;
margin-left:50px;
}
#quote2{
float:left;
width:300px;
height:300px;
margin-bottom:25px;
margin-left:50px;
}
#quote1 p{
font-family:"garamond", "Times New Roman", Times, serif;
font-style:italic;
padding: 20px;
font-size:25px;
margin-top:0;
}
#quote2 p{
font-family:"garamond", "Times New Roman", Times, serif;
font-style:italic;
padding: 20px;
font-size:25px;
margin-top:0;
}
#quote3 p{
font-family: "calibri", Arial, Helvetica, sans-serif;
font-size:15px;
margin-top:0;
text-align:right;
}
#quotes h2{
font-family: "calibri", Verdana, Geneva, sans-serif;
font-size:20px;
padding:10px;
color: #003366;
text-shadow: 0px 2px 1px white;
margin-top:0;
line-height:2px;
text-align:right;
}
#footer_wrap{
background-image: url(Images/footerbg.png);
background-repeat: repeat-x;
background-position:center center;
height:250px;
width:100%;
line-height:2em;
}
#footer{
height:100px;
width:1100px;
margin:auto;
}
#footer p{
font-family:helvetica, arial, verdana, sans-serif;
font-size:12px;
text-align:center;
color:white;
margin-top:0;
padding-top:15px;
text-shadow: 0px 2px 1px black;
}
/* CSS Contact Form */
#container {
float:left;
width:300px;
height:300px;
margin-bottom:25px;
margin-left:50px;
border:none;
}
/*contact form*/
#mask {
background-color:#000;
display:none;
left:0;
position:absolute;
top:0;
width:100%;
height:1450px;
z-index:9000;
}
#contact {
background:url(Images/bgwrap.jpg);
display:none;
left:50%;
margin-left:-300px;
position:absolute;
top:90px;
width:600px;
z-index:9999;
border-radius:10px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
padding:20px 20px 0px;
}
#social {
width:200px;
position:absolute;
left:370px;
top:120px;
padding-left:30px;
border-left: 2px solid #663333;
border-radius:10px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
}
#email2 {
font-family: Verdana, Geneva, sans-serif;
font-size:10pt;
font-style:italic;
text-align:left;
color: #663333;
}
#email2 h3 {
font-family: "Courier New", Courier, monospace;
font-size:14pt;
font-style:normal;
}
#close {
background:url(Images/close.png) no-repeat right;
cursor:pointer;
height:24px;
width:24px;
position:relative;
left:605px;
bottom:30px;
}
#contact_header {
background:url(Images/contact_header.png) no-repeat left;
font-family:arial, sans-serif;
font-size:30px;
font-weight:700;
line-height:50px;
padding:5px 5px 10px 60px;
height:40px;
}
/* form components */
input,textarea {
border:1px solid silver;
background-color:#fff;
color:#404040;
font-size:10px;
font-family:Verdana, Arial, sans-serif;
text-transform:regular;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
margin:10px 0;
padding:10px;
}
input:hover[type=text],input:focus[type=text],textarea:hover,textarea:focus {
background-color:#E0E0E0;
border:1px solid #000;
}
input[type=text],textarea {
width:300px;
}
#submit {
border:none;
width:181px;
height:54px;
background:url(Images/submit.png);
}
#submit:hover {
cursor:pointer;
}
/* alert messages */
.success,.error {
color:#000;
display:none;
font-size:15px;
font-weight:700;
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
padding:5px 10px 5px 10px;
margin-bottom: 10px;
}
.success {
background-color:#9F6;
border:1px solid #0F0;
width:300px;
}
.error {
background-color:#F66;
border:1px solid red;
width:300px;
}