# help with php contact us script

**URL:** <https://www.phphelp.com/t/help-with-php-contact-us-script/10544>\
**Category:** General PHP Help\
**Created:** [November 10, 2007, 5:16pm UTC](https://www.phphelp.com/t/help-with-php-contact-us-script/10544 "2007-11-10T17:16:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![academy](https://www.phphelp.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@academy](https://www.phphelp.com/u/academy)\
**Post date:** [November 10, 2007, 5:16pm UTC](https://www.phphelp.com/t/help-with-php-contact-us-script/10544/1 "2007-11-10T17:16:52Z")

</div>

on my site i put a contact us script but whenever you press submit a error page comes up. i don’t know what part to put my email in this code so it will send to my email please help. where it says your\_email, i put my email there and it still doesnt work.

* * *
\<?php Error\_Reporting(E\_ALL & ~E\_NOTICE); while ($request = current($\_REQUEST)) { if (key($\_REQUEST)!='recipient') { $pre\_array=split ("&777&", $request); $post\_vars[key($\_REQUEST)][0]=preg\_replace ("/\<[^\>]\*\>/", "", $pre\_array[0]); $post\_vars[key($\_REQUEST)][1]=preg\_replace ("/\<[^\>]\*\>/", "", $pre\_array[1]); } next($\_REQUEST); } reset($post\_vars); $subject="From ".$post\_vars['your\_name'][0] ; $headers= "From: ".$post\_vars['your\_email'][0] ."n"; $headers.='Content-type: text/html; charset=iso-8859-1'; $message=''; while ($mess = current($post\_vars)) { if ((key($post\_vars)!="i") && (key($post\_vars)!="your\_email") && (key($post\_vars)!="your\_name")) { $message.="**".$mess[1]."**&nbsp;&nbsp;&nbsp;".$mess[0]."  
"; } next($post\_vars); } mail($\_REQUEST['recipient'], $subject, " Contact letter  
 ".$message." " , $headers); echo ("Your message was successfully sent!"); ?\>
* * *

---

<div class="post-metadata">

**Author:** ![Q1712](https://www.phphelp.com/letter_avatar_proxy/v4/letter/q/a183cd/32.png) [@Q1712](https://www.phphelp.com/u/Q1712)\
**Post date:** [November 11, 2007, 11:34am UTC](https://www.phphelp.com/t/help-with-php-contact-us-script/10544/2 "2007-11-11T11:34:25Z")

</div>

put it there:

[code]mail("uremail@urdomain.de", $subject, "

...[/code]

[http://php.net/mail](http://php.net/mail)
