# PHP4 mailform

**URL:** <https://forum.kirupa.com/t/php4-mailform/14417>\
**Category:** flash\
**Created:** [February 25, 2003, 11:29pm UTC](https://forum.kirupa.com/t/php4-mailform/14417 "2003-02-25T23:29:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragonwill](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dragonwill](https://forum.kirupa.com/u/dragonwill)\
**Post date:** [February 25, 2003, 11:29pm UTC](https://forum.kirupa.com/t/php4-mailform/14417/1 "2003-02-25T23:29:29Z")

</div>

Hello,

I origanally posted a thread for an ASP form mailer with flash. I got that to work, thank you for everyone who replied and helped me with that.

I have another problem now. My client never told me he is on a Linux server. I can’t use ASP, I have to use PHP4. Does anyone have a PHP4 script that sends a simple form to email? I need the script and know how to call it from flash. There are only four fields and should be pretty easy for anyone who knows this stuff. Please reply if you can help, I will send you a link to the movie so you can see what I am trying to do. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 25, 2003, 11:34pm UTC](https://forum.kirupa.com/t/php4-mailform/14417/2 "2003-02-25T23:34:04Z")

</div>

do a search of the forums for “PHP mailform” and you will find a good answer. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2003, 12:13am UTC](https://forum.kirupa.com/t/php4-mailform/14417/3 "2003-02-26T00:13:14Z")

</div>

Try this…

PHP part:

```php
<?
$datetime = date('dmY.His');

$post = "<html><body>

<p>$name<br>

$comment</p>

</body></html>";

$fp = fopen("$datetime.html", "w");
fwrite($fp,$post);
fclose($fp);

$redirect = "$datetime.html";
header('Location: '.$redirect);
?> 

```

HTML part:

```php
<html><body>
<form action="post.php" method="post">
<p>Name:<br>
<input type="text" name="name" size="20"></p>
<p>Comments<br>
<textarea name="comment" cols="50" rows="10"></textarea></p>
<input type="submit" value="post"></form>
</body></html> 

```
