# PHP/HTML Contact Page.. PLEASE HELP!

**URL:** <https://forum.kirupa.com/t/php-html-contact-page-please-help/191804>\
**Category:** Uncategorized\
**Created:** [June 23, 2006, 4:10am UTC](https://forum.kirupa.com/t/php-html-contact-page-please-help/191804 "2006-06-23T04:10:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirracle4](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@mirracle4](https://forum.kirupa.com/u/mirracle4)\
**Post date:** [June 23, 2006, 4:10am UTC](https://forum.kirupa.com/t/php-html-contact-page-please-help/191804/1 "2006-06-23T04:10:31Z")

</div>

Hey I followed a tutorial on how to make a php contact form and put the form on my site. Its a contact form with test fields, check boxes, dropdown menu, and radio buttons.

the html code for it is…

\<html\>  
\<head\>  
\<meta http-equiv=“Content-Language” content=“en-us”\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=windows-1252”\>  
\<title\>New Page 1\</title\>  
\</head\>  
\<body\>  
\<form method=“POST” action=“mailer.php”\>  
Name:  
\<input type=“text” name=“name” size=“19”\>\<br\>  
\<br\>  
E-Mail:  
\<input type=“text” name=“email” size=“19”\>\<br\>  
\<br\>

\<input type=“checkbox” name=“check[]” value=“blue\_color”\> Blue\<br\>  
\<input type=“checkbox” name=“check[]” value=“green\_color”\> Green\<br\>  
\<input type=“checkbox” name=“check[]” value=“orange\_color”\> Orange\<br\>  
\<br\>  
\<input type=“radio” value=“yes” name=“radio”\> YES\<br\>  
\<input type=“radio” value=“no” name=“radio”\> NO  
\<br\>  
\<br\>  
\<select size=“1” name=“drop\_down”\>  
\<option\>php\</option\>  
\<option\>xml\</option\>  
\<option\>asp\</option\>  
\<option\>jsp\</option\>  
\</select\>\<br\>  
\<br\>  
Message:\<br\>  
\<textarea rows=“9” name=“message” cols=“30”\>\</textarea\>\<br\>  
\<br\>  
\<input type=“submit” value=“Submit” name=“submit”\>  
\</form\>  
\</body\>  
\</html\>

the php code is…

\<?php  
if(isset($\_POST[‘submit’])) {  
$to = “[email@hotmail.com](mailto:email@hotmail.com)”;  
$subject = “Form Tutorial”;  
$name\_field = $\_POST[‘name’];  
$email\_field = $\_POST[‘email’];  
$message = $\_POST[‘message’];  
$option = $\_POST[‘radio’];  
$dropdown = $\_POST[‘drop\_down’];  
foreach($\_POST[‘check’] as $value) {  
$check\_msg .= "Checked: $value  
";  
}

$body = "From: $name\_field  
E-Mail: $email\_field  
$check\_msg Option: $option  
Drop-Down: $dropdown  
Message:  
$message  
";  
echo “Data has been submitted to $to!”;  
mail($to, $subject, $body);

} else {  
echo “blarg!”;  
}  
?\>

when I fill out the form and click submit a php page comes up saying:

**Notice** : Undefined variable: check\_msg in **D:\Inetpub\[GARYBMX.COM](http://GARYBMX.COM)\mailer.php** on line **13**  
Data has been submitted to [email@hotmail.com](mailto:email@hotmail.com)!

but it does send the email correctly. Can anyone help me get rid of that error message that comes up? also, can anyone tell me make the browser go to a thank you html page when you click submit? Thanks for any help!
