HI,
I have a contact page made in Flash and it has a range of variables such as "txtName" etc on the page, in the swf movie. My code on the submit button is as follows:

on (release) {
loadVariablesNum("send.php", 0, "GET");
nextFrame();
}

Unfortunately the email is sent and arrives without the variables that are listed on the page. The "send.php" code is listed below:

<?php

$sub = "Contact From Sunlinemedia Website";
$msg="<table width='500' align='left'>

<tr>
<td> Name : </td><td> $txtName </td>
</tr>
<tr>
<td> Title : </td><td> $txtTitle </td>
</tr>

<tr>
<td> Company : </td><td> $txtCompany </td>
</tr>

<tr>
<td> Address : </td><td> $txtAddress </td>
</tr>

<tr>
<td> City : </td><td> $txtCity </td>
</tr>

<tr>
<td> State : </td><td> $txtState </td>
</tr>

<tr>
<td> Postcode : </td><td> $txtPcode </td>
</tr>

<tr>
<td> Telephone : </td><td> $txtTele </td>
</tr>

<tr>
<td> Facsimile : </td><td> $txtFac </td>
</tr>

<tr>
<td> Email : </td><td> $txtEmail </td>
</tr>

</table>";

$emal = $txtEmail;
$eml = "greg@sunline.com.au";

// add another header
$headers = "From:" . $emal ."\nReply-To: " .$emal. "\nContent-Type: text/html; charset=iso-8859-1;";
mail("$eml", "$sub", "$msg", "$headers");
?>

Can someone please help me with this one?

Thanks Greg.

    Does your server have 'register_globals' turned on?
    If so, PHP will automagically generate the post vars for you script. If not you'll have to get them yourself.

    Here is a bit of code that will do this for you:

    foreach ($_POST as $i => $j) {
        ${$i} = $j;
    }
    

    Note, however, that it is not recommended to have register_globals turned on, as this gives crackers a way to attack you site.

    hth
    Robin

      Hi Robin,

      thanks for your script.

      Where do I put this script? In the button code or the send.php file?

      Also does it matter if I use post or get?

      I have tried placing this code in the send.php file and it prevents the email getting sent at all??

      thanks Greg.

        Hi,

        is there anyone there who can help me with this, as I am a struggling newbie to php ; )

        thanks

        Greg.

          Write a Reply...