Well, I installed XAMPP 1.8.1. yesterday and I tried to test my web form and email.php file which is supposed to forward the message of the people who want to contact me - directly into my inbox. However, that doesn't happens and I can't figure out why.
Here is my HTML code:
- Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>Slide Down Contact Form</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.min.js'></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<link rel='stylesheet' type='text/css' href='http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css'/>
<script type='text/javascript' src='dropbox.js'></script>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div class="container">
<div id="button" class="title">
<h6>Contact</h6>
</div>
<div id="dropbox">
<header class="title">
<h6>Whats up?</h6>
</header>
<div class="contact-form">
<form action="email.php" action="post">
<h6><img src="img/person.png" alt="" /> Name</h6>
<input type="text" placeholder="Please enter your full name here" required />
<h6><img src="img/email.png" alt="" /> E-mail</h6>
<input type="email" placeholder="Please enter your e-mail address" required/>
<h6><img src="img/message.png" alt="" /> Message</h6>
<textarea placeholder="Type your message..." required/></textarea>
<input type="submit" value="Submit">
</form>
</div>
</div>
</div>
<script src="dropbox.js"></script>
</body>
</html>
Here is my CSS code:
- Code: Select all
@import url("reset.css");
#button {
position: absolute;
top: 0;
right: 10%;
color: #eee;
z-index: 2;
width: 175px;
background: #c20000;
text-align: center;
height: 40px;
-webkit-border-radius: 0px 0px 2x 2px;
border-radius: 0px 0px 2px 2px;
font-family: Tahoma, Geneva, sans-serif;
font-size: 1em;
text-transform: uppercase;
}
#button:hover {
background: #da0000;
cursor: pointer;
}
#button > h6{
line-height: 40px;
margin: 0px;
padding-top: 0px;
font-family: Tahoma, Geneva, sans-serif;
font-size: 0.8em;
text-transform: uppercase;
}
#dropbox {
position: absolute;
top: 0px;
right: 10%;
color: #eee;
z-index: 1;
background: #222222;
width: 350px;
display: none;
-webkit-box-shadow: 0px 0px 16px rgba(50, 50, 50, 0.75);
-moz-box-shadow: 0px 0px 16px rgba(50, 50, 50, 0.75);
box-shadow: 0px 0px 16px rgba(50, 50, 50, 0.75);
}
#dropbox .title {
height: 40px;
background: #414141;
}
#dropbox .title > h6{
line-height: 40px;
padding-left: 58px;
margin-top: 0px;
}
#dropbox {
font-family: Tahoma, Geneva, sans-serif;
font-size: 1em;
text-transform: uppercase;
}
#dropbox .contact-form {
margin: 10px;
}
#dropbox .contact-form h6{
margin: 5px;
}
#dropbox input {
font-family: Tahoma, Geneva, sans-serif;
font-size: 0.9em;
outline: none;
border: none;
width: 320px;
max-width: 330px;
padding: 5px;
margin: 10px 0px;
background: #444444;
color: #eee;
}
#dropbox textarea {
height: 70px;
font-family: Tahoma, Geneva, sans-serif;
font-size: 0.9em;
outline: none;
border: none;
width: 320px;
max-width: 320px;
padding: 5px;
margin: 10px 0px;
background: #444444;
color: #eee;
}
#dropbox input[type=submit] {
margin: 0px;
width: 330px;
cursor: pointer;
color: #999;
font-family: Tahoma, Geneva, sans-serif;
font-size: 0.8em;
text-transform: uppercase;
font-weight: bold;
}
#dropbox input[type=submit]:hover {
color: #eee;
background: #c20000;
}
Here is my jQuery saved as dropbox.js:
- Code: Select all
$(document).ready(function () {
$('#button').mouseenter(function() {
if($('#dropbox').is(':hidden')) {
$('#dropbox').slideDown('fast', function() {
// slidedown animation
});
} else {
$('#dropdox').hide();
}
});
$('#dropbox').mouseleave(function() {
$('#dropbox').slideUp('fast', function() {
// slide back up
});
});
});
And here is my PHP code saved as email.php:
- Code: Select all
<?php
$name= $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
mail( "myemail@domain.com", "Feedback Form Results",
$message, "From: $email" );
header( 'Location: Index.html' );
?>
Finally, here is my problem:
1. I copy-pasted all of the above files into:
file:///C:/xampp/htdocs
2. I started all servers at XAMPP control panel and checked their status which says:
MySQL database ACTIVATED
PHP ACTIVATED
HTTPS (SSL) ACTIVATED
Common Gateway Interface (CGI) ACTIVATED
Server Side Includes (SSI) ACTIVATED
SMTP Service ACTIVATED
FTP Service ACTIVATED
Tomcat Service ACTIVATED
3. In C:/xampp/htdocs there is an index.html document. When I click on it it opens (I use Mozilla Firefox) and it says: IT WORKS!
4. Still, when I open my web form (which is located in C:/xampp/htdocs) and when I fill it and submit the message for testing, the e-mail is never forwarded to my inbox???
Now, I am not sure if maybe my PHP code is not good (feel free to fix it, please) or there are some settings with XAMPP that I have to fix in order to make it work!
What are the servers that I need to start in order to forward the message to my e-mail address???
I apologize for such a lengthy question but I wanted to give you as much info as I could about my problem in order to make it easier for you to help me solve it.
Many thanks in advance to all of you!!!