# PHP script for emailer

**URL:** https://forum.kirupa.com/t/php-script-for-emailer/11374
**Category:** programming
**Created:** [January 16, 2003, 8:47am UTC](https://forum.kirupa.com/t/php-script-for-emailer/11374 "2003-01-16T08:47:49Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![comicGeek](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@comicGeek](https://forum.kirupa.com/u/comicGeek)
#### Post date: [January 16, 2003, 8:47am UTC](https://forum.kirupa.com/t/php-script-for-emailer/11374/1 "2003-01-16T08:47:49Z")

</div>

Hi all!

Can someone please give me a PHP script that I can use for my HTML and Flash forms?

I have made some form asking for the name, address, email, and comments from my website visitors. I have done this by using a free service from bravenet.

I would really appreciate some help. Help, please Anyone?

=)

comicGeek

---

<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: [January 16, 2003, 1:08pm UTC](https://forum.kirupa.com/t/php-script-for-emailer/11374/2 "2003-01-16T13:08:55Z")

</div>

Hi,

I had the same problems as you have at the moment with flash and php. Have you designed the form? Linked the fields to variable names etc?

The php code I used was:

\<html\>  
\<body\>  
\<?php  
$ToEmail = "northls@nbkayaking.com";

$ToSubject = “Enquiry”;

$BrowserType = $HTTP\_USER\_AGENT;

$MediaTypes = $HTTP\_ACCEPT;

$ServerName= $REMOTE\_ADDR;

$EmailBody = "Sent By: $FirstName  
Senders Email: $Email

Message Sent:  
$ToComments

$BrowserType  
$MediaTypes  
$ServerName";

mail($ToName." \<".$ToEmail."\>",$ToSubject, $EmailBody, “From: “.$FirstName.” \<”.$Email."\>");  
?\>  
\</body\>  
\</html\>

The method is as follows:

(If you need actionscript for the send button then let me know)

copy the php code to your mail server in the same folder as your html and swf files and call it mailPHP.php

before doing this however you need to change a few bits in the php code.

In the above code $email, $FirstName and $comments are all php variables passed values through flash, i.e. I have in my form three text boxes, with the variable names email,FirstName and Comments, get the idea.

In order for the code to work on your project we need to make sure that the variable fields in flash are captured by the php code.

Don’t worry about the rest of the php code, we can tailor that later to capture things such as browser type of the person that filled out the info and dates and times etc.

I am new to php and flash and only figured this out through trial and research. I can help you as much as you need it, but first make sure the form is ready to go, with variable names assigned etc. Why not post the variable names so we can start building the php code.

My knowledge is not limitless but I can get you up and running

---

<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: [January 17, 2003, 5:24am UTC](https://forum.kirupa.com/t/php-script-for-emailer/11374/3 "2003-01-17T05:24:06Z")

</div>

Actually I already did that part and it works well with free emailer service from response-o-matic. The thing is I wanted to use loadVariables instead of getURL which opens a new window. I don’t want that.

I have attached the Flash form here. Please see if it is okay!

Can I add new variable to the PHP script. In case I want to add some more fields in the form or radio buttons and stuff?

comicGeek

:-\

---

<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: [January 17, 2003, 8:57am UTC](https://forum.kirupa.com/t/php-script-for-emailer/11374/4 "2003-01-17T08:57:13Z")

</div>

Of course you can add new variables in the php script.

All php variables begin with $name.

If you use checkboxes then as long as they are associated with variables in flash, they can be carried over into php. This is the method I used with my own php script.

I don’t have flash on my cpu at work but I will copy your fla over to my home machine and look at it tonight.

---

<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: [January 17, 2003, 9:07am UTC](https://forum.kirupa.com/t/php-script-for-emailer/11374/5 "2003-01-17T09:07:03Z")

</div>

That would be great thanks. I’ll wait for the results! heheehe

🙂

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: [January 24, 2003, 6:51pm UTC](https://forum.kirupa.com/t/php-script-for-emailer/11374/6 "2003-01-24T18:51:34Z")

</div>

I have a bit of time to do the fla and php script for you. Before I do can I ask if you still need it. I don’t want to waste my time doing it if you have sussed it out.

Come back to me and I can do the bits you need. It should only take a few moments.

---

<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: [January 25, 2003, 5:10am UTC](https://forum.kirupa.com/t/php-script-for-emailer/11374/7 "2003-01-25T05:10:45Z")

</div>

I’m okay now I made my own script after some reading on php. thanks for the help!

🙂

comicGeek
