titrokb Posted November 22, 2008 Share Posted November 22, 2008 Hey I have had trouble making a flash website with a contact form. The PHP script works along with the SWF but only when the SWF is on my computer and the PHP is on the server. If I try to do it while the SWF is on the server it fails. PHP Code: <?PHP $to = "######@live.com"; $subject = "####### Form"; $message = "Name:\n " . $theName; $message .= "\nEmail:\n " . $theEmail; $message .= "\n\nMessage: \n" . $theMessage; $headers = "From: $theEmail"; $headers .= "\nReply-To: $theEmail"; $sentOk = mail($to,$subject,$message,$headers); echo "sentOk=" . $sentOk; ?> Action Script: stop(); var senderLoad:LoadVars = new LoadVars(); var receiveLoad:LoadVars = new LoadVars(); sender.onRelease = function() { senderLoad.theName = theName.text; senderLoad.theEmail = theEmail.text; senderLoad.theMessage = theMessage.text; senderLoad.sendAndLoad("http://############.com/send.php",receiveLoad); } receiveLoad.onLoad = function() { if(this.sentOk) { _root.gotoAndStop("success"); } else { _root.gotoAndStop("failed"); } } All this works until I try to access the form when its uploaded on the server. Please help me. Link to comment https://forums.phpfreaks.com/topic/133758-php-mail-flash/ Share on other sites More sharing options...
corbin Posted November 22, 2008 Share Posted November 22, 2008 senderLoad.sendAndLoad("http://############.com/send.php",receiveLoad); Make that a relative path. IE: senderLoad.sendAndLoad("/send.php",receiveLoad); Where send is on the same host. Link to comment https://forums.phpfreaks.com/topic/133758-php-mail-flash/#findComment-696265 Share on other sites More sharing options...
titrokb Posted November 23, 2008 Author Share Posted November 23, 2008 Thank you very much. It worked. Link to comment https://forums.phpfreaks.com/topic/133758-php-mail-flash/#findComment-696758 Share on other sites More sharing options...
corbin Posted November 23, 2008 Share Posted November 23, 2008 No problem ;p. Link to comment https://forums.phpfreaks.com/topic/133758-php-mail-flash/#findComment-696874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.