# Transforming old php mail script for a php-noob

**URL:** <https://forum.kirupa.com/t/transforming-old-php-mail-script-for-a-php-noob/256183>\
**Category:** programming\
**Created:** [March 31, 2008, 5:32pm UTC](https://forum.kirupa.com/t/transforming-old-php-mail-script-for-a-php-noob/256183 "2008-03-31T17:32:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![goeiste](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/goeiste/32/2741_2.png) [@goeiste](https://forum.kirupa.com/u/goeiste)\
**Post date:** [March 31, 2008, 5:32pm UTC](https://forum.kirupa.com/t/transforming-old-php-mail-script-for-a-php-noob/256183/1 "2008-03-31T17:32:13Z")

</div>

Hello all,

I have used this php script in the past to be able to mail from a flash file. The main advantage from this form is that it has multiple entry boxes, and that the mail is well structured. I’m really a noob when it comes to php, and I’m confronted with a problem. This script seems to be written in an old version of php, and it doenst function on the server my website is on. i tried to use different scripts that I found on the internet, but they are not as good as this one (e.g only three comment fields, in stead of the multiple i have right now). Thus can anybody help me in transforming this script into a working php 4 or 5 script?

The script I used is as follows (I’ve already added php after the \<?):

```php
<?php
//pas de onderstaande variabelen aan naar jouw wensen
$adminaddress = "bashennephof@gmail.com"; 
//$siteaddress ="http://www.jouwwebsite.nl"; 
$sitename = "jouwwebsitenaam"; 
//hieronder hoeft in principe niets ge-edit te worden...
 
// Haalt de tijd en de datum van de server
$date = date("m/d/Y H:i:s");
 
// Haalt de informatie dat gepost is door Flash
$action = $HTTP_POST_VARS['action'] ;
$woonplaats = $HTTP_POST_VARS['woonplaats'] ;
$naam = $HTTP_POST_VARS['naam'] ;
$adres = $HTTP_POST_VARS['adres'] ;
$postcode = $HTTP_POST_VARS['postcode'] ;
$telefoon = $HTTP_POST_VARS['telefoon'] ;
$comments = $HTTP_POST_VARS['comments'] ;
//De informatie uit de tekstbalken (de variabelen) wordt gestructureerd naar jouw email adres gestuurd.
if ($action == "send") {
 //hieronder kan de tekst worden aangepast
 //een harde enter wordt weergegeven als /n
 //alles na een $-teken is een variabele
 mail ("$adminaddress","Info Request",
 "Een bezoeker van $sitename heeft het volgende bericht achtergelaten

 Voornaam: $Naam 
 Adres: $adres
 Woonplaats: $woonplaats
 Postcode: $postcode
 Telefoon: $telefoon

 Bericht van $naam:
 ______________________________
 
 $comments
 
 
 ______________________________
 Date/Time: $date","FROM:$adminaddress" ) ; 
 
 
}
?>

```
