y.t. Posted March 10, 2010 Share Posted March 10, 2010 This is my first post, so let me first say 'hello'. I have written a simple form handler which works on my testing server; when I deploy to my client's GoDaddy server the message fails. I have contacted GoDaddy's support and have been told the following: "If you use the mail() function in your PHP, you do not need to specify an outgoing mail server. If you are using some other method besides mail() in your PHP code, use relay-hosting.secureserver.net for your relay server." I DO use the mail() function and do not specify an outgoing mail server...the following is my code: <?php $contact_name = $_POST['name']; $contact_email = $_POST['email']; $contact_phone = $_POST['phone']; $contact_message = $_POST['message']; if( $contact_name == true ) { $sender = $contact_email; $receiver = "me@somewhere.com"; $phone = $contact_phone; $receiver2 = $contact_email; $client_ip = $_SERVER['REMOTE_ADDR']; $email_body = "Name: $contact_name \nEmail: $sender \n\nPhone: $phone\n\nMessage: \n\n$contact_message \n\nIP: $client_ip \n\n"; if( mail( $receiver, "Contacted via Web Site - $contact_subject", $email_body )) { echo "success=yes"; } else { echo "success=no"; } } ?> Any idea on what I am missing?? Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/ Share on other sites More sharing options...
The Eagle Posted March 10, 2010 Share Posted March 10, 2010 Make sure the variables on your HTML form match up with your PHP-side. Also $contact_subject isn't being grabbed. Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024031 Share on other sites More sharing options...
y.t. Posted March 10, 2010 Author Share Posted March 10, 2010 Thank you for catching the subject issue. *this issue resolved. The message still fails. I have written my form in ActionScript 3, not HTML. The following is my AS: function sendText (event:MouseEvent):void { if( inputName.text == "" || inputEmail.text == "" || inputPhone.text == "" || inputMessage.text == "") { statusText.text = "Please fill in all text fields."; } else if( !validate_email(inputEmail.text) ) { statusText.text = "Email not valid."; } else { statusText.text = "sending..."; var email_data:String = "name=" + inputName.text + "&email=" + inputEmail.text + "&phone=" + inputPhone.text + "&message=" + inputMessage.text; var URL_vars:URLVariables = new URLVariables(email_data); URL_vars.dataFormat = URLLoaderDataFormat.TEXT; URL_request.data = URL_vars; var_load.load( URL_request ); var_load.addEventListener(Event.COMPLETE, receive_response ); } } function receive_response(e:Event):void { var loader:URLLoader = URLLoader(e.target); var email_status = new URLVariables(loader.data).success; if( email_status == "yes" ) { statusText.text = "Your message was sent."; timer = new Timer(500); timer.addEventListener(TimerEvent.TIMER, on_timer); timer.start(); } else { statusText.text = "Message Failed!"; } } I'm officially stumped. I have been on this one issue now for just over four hours. :'( All I get in response when testing is "Message Failed." *maybe I should just change my message status Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024035 Share on other sites More sharing options...
The Eagle Posted March 10, 2010 Share Posted March 10, 2010 What is the name of your PHP file, (the one you put in your first post)? Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024038 Share on other sites More sharing options...
y.t. Posted March 10, 2010 Author Share Posted March 10, 2010 name of PHP file = "se.php" Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024039 Share on other sites More sharing options...
The Eagle Posted March 10, 2010 Share Posted March 10, 2010 function sendText (event:MouseEvent):void { if( inputName.text == "" || inputEmail.text == "" || inputPhone.text == "" || inputMessage.text == "") { statusText.text = "Please fill in all text fields."; } else if( !validate_email(inputEmail.text) ) { statusText.text = "Email not valid."; } else { statusText.text = "sending..."; var email_data:String = "name=" + inputName.text + "&email=" + inputEmail.text + "&phone=" + inputPhone.text + "&message=" + inputMessage.text; var URL_vars:URLVariables = new URLVariables(email_data); URL_vars.dataFormat = URLLoaderDataFormat.TEXT; URL_request.data = URL_vars; var_load.load( URL_request ); var_load.addEventListener(Event.COMPLETE, receive_response ); } } function receive_response(e:Event):void { var loader:URLLoader = URLLoader(e.target); var email_status = new URLVariables(loader.data).success; if( email_status == "yes" ) { statusText.text = "Your message was sent."; timer = new Timer(500); timer.addEventListener(TimerEvent.TIMER, on_timer); timer.start(); } else { statusText.text = "Message Failed!"; } } I don't see a single part in this script where it is sending the collected data to an "se.php". Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024043 Share on other sites More sharing options...
y.t. Posted March 10, 2010 Author Share Posted March 10, 2010 You are right, the following is listed higher up in my AS code: var var_load:URLLoader = new URLLoader; var URL_request:URLRequest = new URLRequest( "se.php" ); URL_request.method = URLRequestMethod.POST; Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024045 Share on other sites More sharing options...
The Eagle Posted March 10, 2010 Share Posted March 10, 2010 You are right, the following is listed higher up in my AS code: var var_load:URLLoader = new URLLoader; var URL_request:URLRequest = new URLRequest( "se.php" ); URL_request.method = URLRequestMethod.POST; var request:URLRequest = new URLRequest("http://www.yourserver.com/se.php"); request.method = URLRequestMethod.GET; Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024047 Share on other sites More sharing options...
PFMaBiSmAd Posted March 10, 2010 Share Posted March 10, 2010 For debugging purposes, add the following two lines of php code immediately after your first opening <?php tag to get php to show all the errors it detects - ini_set("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024049 Share on other sites More sharing options...
y.t. Posted March 10, 2010 Author Share Posted March 10, 2010 Thank you for your help. Question: When they tell me: "If you use the mail() function in your PHP, you do not need to specify an outgoing mail server. If you are using some other method besides mail() in your PHP code, use relay-hosting.secureserver.net for your relay server." where in the PHP file would I declare the relay-hosting? Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024050 Share on other sites More sharing options...
y.t. Posted March 10, 2010 Author Share Posted March 10, 2010 For debugging purposes, add the following two lines of php code immediately after your first opening <?php tag to get php to show all the errors it detects - ini_set("display_errors", "1"); error_reporting(E_ALL); I have done this and run my form. When I look into the error logs, I don't see one of recent time stamp. They are compressed and time stamped...latest one is 7-something PM EST. Quote Link to comment https://forums.phpfreaks.com/topic/194725-form-handler/#findComment-1024052 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.