Lokee116 Posted March 13, 2007 Share Posted March 13, 2007 Hello, I've made a form in swishmax its part of an advertising splash page. on the submit button i have the following actionscript: on (release) { if ((nameVar=="")||(emailVar=="")||(numberVar=="")||(msgVar=="")) { errormessage="Please fill all the fields"; } else { errormessage="Sending...."; send="yes"; this.loadVariables("http://eznetpro.com/ad/flashq.php",'POST'); nameVar=""; emailVar=""; numberVar=""; msgVar=""; } } I have a file named flashq.php in the specified location. the file looks like this: <? if ($send=="yes") { $to = "[email protected]"; $re = "Question Submission"; $msg .= " Name: "; $msg .=$_POST['nameVar']; $msg .= ", Phone number: "; $msg .=$_POST['numberVar']; $msg .= ", E-Mail: "; $msg .=$_POST['emailVar']; $msg .= ", Question: "; $msg .=$_POST['msgVar']; $tfrom .=$_POST['emailVar']; mail($to,$re,$msg,$tfrom); } echo "&errormessage=Email has been sent&"; ?> Im almost 100% positive that my hosting service supports .php The flash page is being hosted at http://eznetpro.com/ad/eznet.html The problem I'm having is the form isnt being sent. when i launch the flash file from my pc and complete the form it has no problems talking to the php file hosted on the net, and sending the info. but when I upload the flash file and try to complete the form while its hosted online, its not talking to the php and not sending the info.. is there a problem with my code? i cant spot any and im not sure why it would work from my pc but not when hosted online. Please help if you can, or let me know if you need any more info to troubleshoot. Quote Link to comment https://forums.phpfreaks.com/topic/42524-actionscriptphp-form-please-help/ Share on other sites More sharing options...
monk.e.boy Posted March 13, 2007 Share Posted March 13, 2007 write a simple php page: <?php phpinfo(); ?> and try and browse to this new page. This will see if php is installed and what version you have. monk.e.boy Quote Link to comment https://forums.phpfreaks.com/topic/42524-actionscriptphp-form-please-help/#findComment-206344 Share on other sites More sharing options...
Lokee116 Posted March 13, 2007 Author Share Posted March 13, 2007 ok seems i do have php PHP Version 4.3.10 System Windows NT WIN2 5.2 build 3790 Build Date Dec 14 2004 17:46:48 Server API CGI/FastCGI Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS\php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety enabled Registered PHP Streams php, http, ftp, compress.zlib Could there be any other reasons why its not working? Quote Link to comment https://forums.phpfreaks.com/topic/42524-actionscriptphp-form-please-help/#findComment-206350 Share on other sites More sharing options...
peeps Posted March 13, 2007 Share Posted March 13, 2007 Maybe you copied the file wrong. Try changing your first line to <?php inseat of <? Quote Link to comment https://forums.phpfreaks.com/topic/42524-actionscriptphp-form-please-help/#findComment-206353 Share on other sites More sharing options...
Lokee116 Posted March 13, 2007 Author Share Posted March 13, 2007 Maybe you copied the file wrong. Try changing your first line to <?php inseat of <? hmm I tried that and still nothing.. I dont understand I cant find any errors in my code, ref links, or file locations... I have php enabled on the server. it seems to work when the flash file is on my local pc and the php is hosted on the web, but when they are both hosted on the web it doesnt work ??? Quote Link to comment https://forums.phpfreaks.com/topic/42524-actionscriptphp-form-please-help/#findComment-206362 Share on other sites More sharing options...
monk.e.boy Posted March 14, 2007 Share Posted March 14, 2007 Write a test PHP page with a form that posts the same data to the PHP page. The look at the out put and errors. When you get it working ok, then start testing it from the flash. monk.e.boy Quote Link to comment https://forums.phpfreaks.com/topic/42524-actionscriptphp-form-please-help/#findComment-206885 Share on other sites More sharing options...
dp2 Posted June 6, 2008 Share Posted June 6, 2008 This example maybe a more easier approach for swish max just compare your code against this As you know your submit button Action script code: on (press) { //checks if the fields are empty if so shows the error message if (Name=="" or Email=="" or Message=="") { info="Error Sending Message" //checks if the name is more than 2 letters most names are more than 2 letters long //if not shows the error message; } else if (Name.length < 2) { info="Error Sending Message"; } //checks if the Email is more than 3 letters most email addresses are more than 3 letters long //if not shows the error message; else if (Email.length < 3) { info="Error Sending Message"; } //checks that an @ has been entered into the Email Field //if not shows the error message else if (Email.indexOf("@") == -1) { } //checks that an . has been entered into the Email Field //if not shows the error message else if (Email.indexOf(".") == -1) { } //checks that the message is at least 10 letters long //if not shows the error message else if (Message.length < 10) { info="Error Sending Message"; } //if everything has passed the checks it loads the variables //and sends the message else{ info="Message Was Sent"; loadVariables("send.php",'POST'); } } Your external flat file named file:flashq.php can replace the send.php The external file referenced in the submit button: <?php $EmailFrom = "your email address"; $EmailTo = "your email address"; $Subject = "Form submitted from site"; $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Message = Trim(stripslashes($_POST['Message'])); $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .="\n"; $Body .= "Email: "; $Body .= $Email; $Body .="\n"; $Body .= "Message: "; $Body .= $Message; $Body .="\n"; $success -mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); ?> Info box which provides the user error or sent message in response to submitting the form this action script is placed in the scene root and a info box created using the text tool and selecting: Input Text. onLoad () {// carries the function out once Name="";//clears the Name box Email="";//clears the Email box Message="";//clears the Message box info="";//clears the info box } If you can get this script to work then all you do is add the extra fields as required. For a button to reset the form the action script is as follows: on (press) {// carries the function out when button is clicked Name="";//clears the Name box Email="";//clears the Email box Message="";//clears the Message box info="";//clears the info box } Quote Link to comment https://forums.phpfreaks.com/topic/42524-actionscriptphp-form-please-help/#findComment-559213 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.