problem getting my contact form working


Posted on 16th Feb 2014 07:03 pm by admin

Yeah I know this is a pretty basic problem, but it's been a while since I've worked with PHP and I'm having a real problem getting it functioning properly. My real issue is the user inputed information is not getting sent with the email. I haven't added all the fields to the email yet as I'm trying to get it right first then populating all of the fields. Anyway my code is below:

hairinfo.html
Code: <form name="hairinfo" method="POST" action="hair/EmailToForm.php">
<table border="0" align="center" background="images/blackopaque.png" class="contact">
<tr>
<td width="100">Name</td>
<td><input name="name" type="text" id="name" class="contactBox" size="30"></td>
</tr>
<tr>

<td width="100">Service</td>
<td class="contactBox">
<input type="radio" name="hairservice" value="Cut" id="hairservice"> Cut

<input type="radio" name="hairservice" value="Colour" id="hairservice"> Colour

<input type="radio" name="hairservice" value="Hair Up" id="hairservice"> Hair Up

<input type="radio" name="hairservice" value="Set" id="hairservice"> Set

<input type="radio" name="hairservice" value="Style" id="hairservice"> Style
</td>
</tr>
<td width="100">Address</td>
<td><input name="address" type="text" class="contactBox" id="address" size="30"></td>
</tr>
<tr>
<td width="100">City</td>

<td><input name="city" type="text" class="contactBox" size="30"></td>
</tr>
<tr>
<td width="100">Date</td>
<td><input name="date" type="text" class="contactBox160" id="date"/>
<script language="JavaScript">
new tcal ({
// form name
'formname': 'testinput',
// input name
'controlname': 'testinput'
});</script>
</td>
</tr>
<tr>

<td width="100">E-Mail</td>
<td><input name="email" type="text" id="emailaddress" class="contactBox" size="30" ></td>
</tr>
<tr>
<td width="100">Phone Number</td>
<td><input name="phone" type="text" class="contactBox" size="30" id="phone"></td>
</tr>
<tr>

<td width="100">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="100" valign="top">Brief</td>
<td><textarea name="message" cols="23" rows="9" class="contactBox" id="message"></textarea></td>
</tr>
<tr>

<td width="100"></td>
<td><input name="send" type="submit" class="inputField" value="Send" /></td>
</tr>
<tr>
<td colspan="2"><em>For a faster reply, text your booking information to: 021 0259 6543</em></td>
</tr>
</table>
</form>
hair/EmailToForm.php
Code: <?php
// Contact subject
$subject ='Hair Booking';
// Details
$message="$message";

// Mail of sender
$mail_from="$emailaddress";
// From
$header="from: $name <$mail_from>";

// Enter your email address
$to ='kerry@manukadesign.co.nz';

$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "Thanks, we've recived your contact information<br />
and we will be in touch as soon as possible about your request";
}
else {
echo "ERROR";
}
?>
I would really appreciate any help offered.
Thanks

No comments posted yet

Your Answer:

Login to answer
151 Like 51 Dislike
Previous forums Next forums
Other forums

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, Fo

pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main() {

simple script won't work. Please help
I'm new to php, and I am having trouble displaying a simple script in my web browser. My php code ex

Creating web pages by php
Hello again,
I was just wondering us there a way to use a php script to create a new web page. I

Display the user's weight lost in the past week
Hello everyone,

I am working on a weight loss app for my site, and I want to display the user

Help: problem with Headers to download PDF file
Hi,

I'm trying to implement a script where when a user clicks a link he gets a PDF file to op

PHP Form to Variable.
Hi! I have written a HTML-form code in DreamWeaver CS3 (in a PHP doc) and I really need it to work s

order by date not ID number help php
I am trying to orginize the following code to order by date not id number.
any help would be grea

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash