[COLOR=black]I am having a problem making my email form work in my flash website. See for yourself:[/COLOR] www.michaelriosdesigns.com in the ‘contact’ page.
When you fill out the form and press ‘submit’, it says “sending data” but doesn’t complete the operation. It’s supposed to say “Email sent. Thank you.” when the action is complete.
Here is the action script that’s attached to the ‘submit’ button:
[COLOR=navy]on (release) { [/COLOR]
[COLOR=navy]// logical operator makes sure the textfield is not blank. IndexOf checks for “@” and “.” characters in textfield[/COLOR]
[COLOR=navy]if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) { [/COLOR]
[COLOR=navy]results = “Please check your e-mail address.”; [/COLOR]
[COLOR=navy]} else if (!comments.length) { [/COLOR]
[COLOR=navy]results = “Please enter your comments.”; [/COLOR]
[COLOR=navy]} else if (!name.length) { [/COLOR]
[COLOR=navy]results = “Please enter your name.”; [/COLOR]
[COLOR=navy]} else { [/COLOR]
[COLOR=navy]loadVariablesNum ("[/COLOR][COLOR=navy]http://www.michaelriosdesigns.com/mailform.php[/COLOR][COLOR=navy]", 0, “GET”); [/COLOR]
[COLOR=navy]results = “Sending Data…”;[/COLOR]
And then on mailform.php, I have the following script:
[COLOR=navy]<?php
$recipient = “[/COLOR][COLOR=navy]michaelrios@gmail.com[/COLOR][COLOR=navy]”; [/COLOR]
[COLOR=navy]$vars = array(“name”,“email”,“comments”,“results”); [/COLOR]
[COLOR=navy]foreach($vars as $var) [/COLOR]
[COLOR=navy]$var = $_POST[“var”]; [/COLOR]
[COLOR=navy]$comments = str_replace(“r”,“n”,$comments); [/COLOR]
[COLOR=navy]$mail = "Contact from $name email $email
has left the following message: $comments "; [/COLOR]
[COLOR=navy]mail($recipient,“Your Automail”, $comments, “From: $name”); [/COLOR]
[COLOR=navy]print &results=“Email Sent… Thank You.”; [/COLOR]
[COLOR=navy]?>[/COLOR]
Can anyone tell me what’s wrong?:diss: