# Need Help - PHP in Flash

**URL:** <https://forum.kirupa.com/t/need-help-php-in-flash/204781>\
**Category:** Uncategorized\
**Created:** [October 23, 2006, 2:01pm UTC](https://forum.kirupa.com/t/need-help-php-in-flash/204781 "2006-10-23T14:01:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrizzyCube](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@FrizzyCube](https://forum.kirupa.com/u/FrizzyCube)\
**Post date:** [October 23, 2006, 2:01pm UTC](https://forum.kirupa.com/t/need-help-php-in-flash/204781/1 "2006-10-23T14:01:06Z")

</div>

**Need Help - PHP in Flash**  
Hey guys! Been stuck for weeks on making this PHP FLASH MAIL FORM and it’s driving me insane! I’m relatively new to this kind of stuff so bare with me. 😊

First off, I’ve been mainly using this tutorial + resource to build a PHP Flash Form: [http://www.actionscript.org/resource…PHP/Page1.html](http://www.actionscript.org/resources/articles/82/1/Send-Email-via-Flash-and-PHP/Page1.html)

**The Problem:**  
When the form is simplified to a mere: E-mail (From), Subject, Message… it works perfectly. But as soon as I add other variables (in to the PHP and Flash) such as… Full Name, Website, Contact Number… it doesn’t work! I’m stumped!

**All I’m trying to create in this form is…**  
Full Name:  
Your E-mail:  
Your Website:  
Contact Number:  
Subject:  
Message:

**PHP Codes:**  
Code:  
[LEFT]\<?php  
mail(“[booking@frizzycube.com](mailto:booking@frizzycube.com)”, $subject, $message, $fullname, $yourwebsite, $contactnumber, “From: FrizzyCube\_Booking  
Reply-To: $from  
X-Mailer: PHP/” . phpversion());  
?\>[/LEFT]

**Actionscript on the first frame (This was revised in suggestion that the prior code was old):**  
Code:  
[LEFT]stop ();  
function lineAdapt()  
{  
message\_send = message;  
while (msg\_count == msg\_count + 1)  
{  
if ((substring(message\_send, msg\_count, 2)) == “\r”)  
{  
message\_send = (substring(message\_send, 1, msg\_count - 2)) + "  
" + (substring(message\_send, msg\_count + 2, (length(message\_send)) - msg\_count + 2));  
}  
}  
message = message\_send;  
delete msg\_count;  
delete message\_send;  
}[/LEFT]

\*\*Submit Button Actionscript \*\***(This was revised in suggestion that the prior code was old):**  
Code:  
[LEFT]on (release)  
{  
if ((from == “”) || (subject == “”) || (message == “”) || (fullname == “”) || (contactnumber == “”) || (yourwebsite == “”))  
{  
stop();  
}  
else  
{  
lineAdapt();  
loadVariablesNum(“mailing.php3”, 0, “POST”);  
gotoAndStop(2);  
}  
}[/LEFT]

---

<div class="post-metadata">

**Author:** ![iuliux](https://avatars.discourse-cdn.com/v4/letter/i/838e76/32.png) [@iuliux](https://forum.kirupa.com/u/iuliux)\
**Post date:** [October 23, 2006, 4:52pm UTC](https://forum.kirupa.com/t/need-help-php-in-flash/204781/2 "2006-10-23T16:52:33Z")

</div>

is have almost the same problem, but mine is at a lower level… i mean it don’t works at all…

i have some input textfields with the variables: “nume”, “mess” and “rasa”  
and in php i have:  
$sql=“insert into participanti(nume,mess,rasa) values(’”.$nume."’,’".$mess."’,’".$rasa."’)";

and it inserts empty fileds in the database  
i made it from a tutorial… :hurt:

---

<div class="post-metadata">

**Author:** ![iuliux](https://avatars.discourse-cdn.com/v4/letter/i/838e76/32.png) [@iuliux](https://forum.kirupa.com/u/iuliux)\
**Post date:** [October 23, 2006, 5:07pm UTC](https://forum.kirupa.com/t/need-help-php-in-flash/204781/3 "2006-10-23T17:07:28Z")

</div>

wiiiiiiiiiii  
i cant belive it works…  
so… the solution:

[http://www.swish-db.com/tutorials/view.php/tid/222](http://www.swish-db.com/tutorials/view.php/tid/222)

you just have to modify in the php code (becose that tut was made for php3)  
$to = escapeshellcmd($to); with $\_POST[‘to’] = escapeshellcmd($\_POST[‘to’]); and so on to all variables
