# Contact form - help?

**URL:** <https://forum.kirupa.com/t/contact-form-help/238327>\
**Category:** Uncategorized\
**Created:** [September 10, 2007, 3:42am UTC](https://forum.kirupa.com/t/contact-form-help/238327 "2007-09-10T03:42:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lillizzierae](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@lillizzierae](https://forum.kirupa.com/u/lillizzierae)\
**Post date:** [September 10, 2007, 3:42am UTC](https://forum.kirupa.com/t/contact-form-help/238327/1 "2007-09-10T03:42:09Z")

</div>

i’m having some trouble to some reason getting my form to work that i got off this site. i don’t know what the problem is. it’s probably so small that i’m overlooking it. i’m really, really new to php. but here’s the code:

its filename is: contact.php

> 

\<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)”\>  
\<html xmlns=“[XHTML namespace](http://www.w3.org/1999/xhtml)”\>  
\<head\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” /\>  
\<title\>Elizabeth Nichols - Portfolio\</title\>  
\<link href=“css.css” rel=“stylesheet” type=“text/css” /\>  
\<style type=“text/css”\>  
#contact {  
position:absolute;  
left:358px;  
top:655px;  
font-size: 10px;  
width: 373px;  
height: 297px;  
}  
.style2 {font-size: 14px}  
\</style\>  
\</head\>

\<body id=“body”\>

\<div id=“container”\>  
\<div id=“login”\>  
Email Address:\<br /\>  
\<input name=“login” type=“text” size=“18” maxlength=“30” /\>  
\<br /\>  
Password:\<br /\>  
\<input name=“password” type=“password” size=“18” maxlength=“30” /\>  
\<br /\>  
\<p align=“center”\>\<a href=“newmember.php”\>\<img src=“images/button\_new.png” border=“0” /\>\</a\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
\<img src=“images/button\_login.png” /\>\</p\>  
\</div\>

\<div id=“header”\>\<img src=“images/navigation.png” border=“0” usemap=“#navigation” /\>  
\<map name=“navigation” id=“navigation”\>  
\<area shape=“rect” coords=“38,21,107,47” href=“index.php” alt=“home” /\>  
\<area shape=“rect” coords=“124,23,293,48” href=“about.php” alt=“about” /\>  
\<area shape=“rect” coords=“313,20,383,46” href=“work.php” alt=“work” /\>  
\<area shape=“rect” coords=“404,21,472,47” href=“links.php” alt=“link” /\>  
\<area shape=“rect” coords=“495,21,578,46” href=“contact.php” alt=“contact” /\>  
\</map\>\</div\>

```
    &lt;div id="contact"&gt;

    &lt;span class="style2"&gt;Fill out the below form and I'll get back to you as soon as I can.&lt;/span&gt;&lt;br /&gt;
    &lt;br /&gt;&lt;br /&gt;
    &lt;form method="post" action="thankyou.php"&gt;
    &lt;table width="284" height="241" border="0"&gt;

```

\<tr\>  
\<td width=“278” height=“39”\>

```
  &lt;span class="style2"&gt;Name:&lt;/span&gt;&lt;br /&gt;
  &lt;input name="name" type="text" size="20" maxlength="20" /&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;span class="style2"&gt;E-mail Address:&lt;/span&gt;&lt;br /&gt;
  &lt;input name="email" type="test" size="30" maxlength="40" /&gt;&lt;/td&gt;

```

\</tr\>  
\<tr\>  
\<td height=“187”\>\<span class=“style2”\>Comments/Questions:\</span\>\<br /\>  
\<textarea name=“question” cols=“30” rows=“6”\>\</textarea\>  
\<br /\>\<br /\>  
\<input name=“Reset” type=“reset” value=“Clear” /\>  
\<input name=“submit” type=“submit” value=“Submit” /\>\</td\>  
\</tr\>  
\</table\>\</form\>

```
    &lt;br /&gt;

    
    &lt;/div&gt;
    &lt;div id="footer_container"&gt;
  &lt;div id="footer_left"&gt;&copy;2006-2007 Elizabeth Nichols. All Rights Reserved.&lt;/font&gt;&lt;/div&gt;

```

\</div\>

\</div\>  
\</body\>  
\</html\>

and this is the php part. its filename is: thankyou.php

> \<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)”\>

\<html\>  
\<head\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” /\>  
\<title\>Sendemail Script\</title\>  
\</head\>  
\<body\>

\<?php  
if(isset($\_POST[‘submit’])) {

$to = “[lillizzierae@aol.com](mailto:lillizzierae@aol.com)”;  
$subject = “Form Tutorial”;  
$name\_field = $\_POST[‘name’];  
$email\_field = $\_POST[‘email’];  
$question = $\_POST[‘message’];

$body = “From: $name\_field  
E-Mail: $email\_field  
Message:  
$message”;

echo “Data has been submitted to $to!”;  
mail($to, $subject, $body);

} else {

echo “blarg!”;

}  
?\>

\</body\>  
\</html\>
