To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Reply
 
Thread Tools Search this Thread Display Modes
Old 12-17-2006, 04:11 AM   #1
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
Code Check Please...

It's for a eMail form. It used to work but for some reason, it's not working now...Let me rephrase, it does still send the eMail but it's not getting a returning variable, so it will go to the "Thank You" page.

I've looked over the code for hours and can't seem to get it to return the variable...What's weird is that I used this code for the contact form on http://www.nssclan.org and that one suddenly doesn't work either....It did the other day.

Could someone look over the code and see if there is something wrong with it? I wrote this code with Chris' help in when version 4 was out.

Here is the code in the frame of the form.

Code:
// Check for blank fields and submit 
sendbutton.onRelease = function(){
	if(fullname.text == ""||email.text==""||agree.text==""||lastname.text==""||dob.text==""||gbname.text==""||eseal.text==""){
		// If any of the fields are blank
		errormessage._x = 150;
		errormessage.gotoAndPlay("go");
		
		}else{
			var result_lv = new LoadVars();
			result_lv.onLoad = function(success){
				if(success){
					fullname.text="";
					lastname.text="";
					email.text="";
					dob.text="";
					gbname.text="";
					eseal.text="";
					agree.text="";
					myresponse.text = result_lv.returnMe;
					gotoAndPlay("thanks");
						
				}else{
				myresponse.text = "error"
				unknown_error._x = 150;
				unknown_error.gotoAndPlay("go");
				}
			}	
		}
// Send the Data	
var send_lv = new LoadVars();
	send_lv.action = "send";
    send_lv.fullname = fullname.text;
	send_lv.lastname = lastname.text;
	send_lv.email = email.text;
	send_lv.dob = dob.text;
	send_lv.gbname = gbname.text;
	send_lv.eseal = eseal.text;
	send_lv.agree = agree.text;
	send_lv.subject = subject.text;
	send_lv.recipient = recipient.text;
   	send_lv.sendAndLoad("clanrequest.php",result_lv,"POST");
 };
Here is the php code for reading the submission data, sending the email and sending reply back to my movie.
clanrequest.php
PHP Code:
<?

$fullname
= $_POST["fullname"];
$lastname = $_POST["lastname"];
$email_addy = $_POST["email"];
$dob = $_POST["dob"];
$gbname = $_POST["gbname"];
$eseal = $_POST["eseal"];
$agree = $_POST["agree"];
$subject = $_POST["subject"];
$recipient = $_POST["recipient"];
$action = $_POST["action"];


// Log the IP address of sender
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("m/d/Y H:i:s"); // Date the form was sent



if ($action == "send") {
    
mail ("$recipient","$subject",
    
"A visitor has requested to join your clan:\n
    
    From:   $lastname, $fullname
    eMail:  $email_addy
        GB Name: $gbname
        eSeal name: $eseal
        DOB: $dob
        
        $agree, I agree to the clan rules and code of conduct.
            
    
    
    Logged Info :
    ------------------------------
    Using: $HTTP_USER_AGENT
    IP address: $ip
    Date/Time:  $date"
, "FROM:$email_addy") ;
      
      }
      echo
"&returnMe=thanks";
     
?>
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-17-2006, 08:42 AM   #2
Stoke Laurie
That web bloke
 
Stoke Laurie's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 869
<?
ini_set("sendmail_from", " admin@allabouthere.co.uk "); //configure this to you
//LoadVar_Mailform for Koolmoves © 2006 Chris Seahorn (http://sandbox.blogdns.com//cjseahorn@aim.com)
$fullname = $_POST["fullname"];
$lastname = $_POST["lastname"];
$email_addy = $_POST["email"];
$dob = $_POST["dob"];
$gbname = $_POST["gbname"];
$eseal = $_POST["eseal"];
$agree = $_POST["agree"];
$subject = $_POST["subject"];
$recipient = $_POST["recipient"];
$action = $_POST["action"];


$ip = $_SERVER['REMOTE_ADDR'];

$adminaddress = "you@yourwebaddress.com"; //configure this to you
$siteaddress ="your web address"; //configure this to you
$sitename = "Your Site Name"; //configure this to you

$date = date("m/d/Y H:i:s");

$action = $_POST["action"];


if ($action == "send") {
mail ("$adminaddress","A visitor has requested to join your clan\n",

From: $lastname, $fullname
eMail: $email_addy
GB Name: $gbname
eSeal name: $eseal
DOB: $dob

$agree, I agree to the clan rules and code of conduct.


Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
IP address: $ip
Date/Time: $date","FROM:$adminaddress" ) ;



//Confirmation is sent back to the Flash form that the process is complete

echo "&returnMe=thanks";



}


?>
Stoke Laurie is offline   Reply With Quote
Old 12-17-2006, 02:08 PM   #3
blanius
KoolMoves Moderator
 
blanius's Avatar
 
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,911
Looked to me like you should define result_lv here

var send_lv = new LoadVars();
var result_lv=new LoadVars();
send_lv.action = "send";
send_lv.fullname = fullname.text;
send_lv.lastname = lastname.text;
send_lv.email = email.text;
send_lv.dob = dob.text;
send_lv.gbname = gbname.text;
send_lv.eseal = eseal.text;
send_lv.agree = agree.text;
send_lv.subject = subject.text;
send_lv.recipient = recipient.text;
send_lv.sendAndLoad("clanrequest.php",result_lv,"P OST");
};
blanius is offline   Reply With Quote
Old 12-17-2006, 04:29 PM   #4
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
Quote:
Originally Posted by blanius
Looked to me like you should define result_lv here

var send_lv = new LoadVars();
var result_lv=new LoadVars();
send_lv.action = "send";
send_lv.fullname = fullname.text;
send_lv.lastname = lastname.text;
send_lv.email = email.text;
send_lv.dob = dob.text;
send_lv.gbname = gbname.text;
send_lv.eseal = eseal.text;
send_lv.agree = agree.text;
send_lv.subject = subject.text;
send_lv.recipient = recipient.text;
send_lv.sendAndLoad("clanrequest.php",result_lv,"P OST");
};
NO, that change caused the form to not even send the data. Probably because I already called this function in the IF statement.
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

Last edited by dniezby; 12-17-2006 at 04:32 PM.
dniezby is offline   Reply With Quote
Old 12-17-2006, 05:28 PM   #5
Stoke Laurie
That web bloke
 
Stoke Laurie's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 869
Go back to Koolexchange and download Chris's loadvars again.
Change the field names to what you need and the code to match, If I can suggest that you stick to Chris's convention of calling the fields box1 and box2 etc, you will find it easy to trace them through your actionscript and then the php.
I just added this line
ini_set("sendmail_from", " admin@allabouthere.co.uk "); because some servers require this as authority to POST.

Last edited by Stoke Laurie; 12-17-2006 at 05:31 PM.
Stoke Laurie is offline   Reply With Quote
Old 12-17-2006, 08:22 PM   #6
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
Quote:
Originally Posted by Stoke Laurie
Go back to Koolexchange and download Chris's loadvars again.
Change the field names to what you need and the code to match, If I can suggest that you stick to Chris's convention of calling the fields box1 and box2 etc, you will find it easy to trace them through your actionscript and then the php.
I just added this line
ini_set("sendmail_from", " admin@allabouthere.co.uk "); because some servers require this as authority to POST.
I put this in the PHP, but that didn't work either.

You know what pisses me off? It USED to work. I didn't change anything except add fields. I've looked over Chris' code and it's the same.

I just wish I knew "where" the error was. I think it's in the PHP echoing back...
Any thoughts on how I can test to see if it really is echoing out?
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-17-2006, 10:15 PM   #7
blanius
KoolMoves Moderator
 
blanius's Avatar
 
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,911
call the PHP file directly in the browser. Also I'm willing to bet it's in the actionscript and has to do with differences in flash 8, which would explain why it stopped working as that probably is something that DID change.
blanius is offline   Reply With Quote
Old 12-18-2006, 01:04 AM   #8
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
You're right, the PHP returns correctly...

Hmm, then I wonder what the heck I can do now.

The whole issue isn't the actual sending of the form. That works fine. I was using the return value to wait for confirmation from the PHP then move on to the thankyou page.

Any thoughts?
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-18-2006, 03:34 PM   #9
Stoke Laurie
That web bloke
 
Stoke Laurie's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 869
Why don't you try Chris's as a control by loading his swf and php to your server, assuming the echo is returned you then know you have a version that does what you want, all you then need to do is redress the swf to look the way you want it to, leave the variable the way Chris created them and simply change the text boxes to reflect what you want them to type in.
Stoke Laurie is offline   Reply With Quote
Old 12-18-2006, 04:45 PM   #10
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
Well, I figured out the problem.

It seems that the return variable may have been getting stuck elsewhere in the movie.

The problem was here:

Code:
myresponse.text = result_lv.returnMe;
gotoAndPlay("thanks");
And here is the solution:

Code:
_root.gotoAndPlay("thanks');
Something must have changed in Flash 8 to make me have to specify that the returning variable needed to go back to the root.

You can see the live form at
http://www.nssclan.orgl Then click the JOIN US button.
Just put DEMO in for your email address if you're goint to try it. All the cool stuff happens after you send the form.
NOTE: JUST IN CASE THE FORM DOESN'T OPEN, (I'M TESTING SOME JAVASCRIPT TO OPEN THE FORM IN A NEW WINDOW) You can go directly to the form at http://www.nssclan.org/forms/joinclan.html
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

Last edited by dniezby; 12-18-2006 at 05:19 PM.
dniezby is offline   Reply With Quote
Old 12-18-2006, 05:22 PM   #11
Stoke Laurie
That web bloke
 
Stoke Laurie's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 869
Excellent glad you found the answer. Tried the form very good.
If I were you I would check the point size or the size of the text fields that you fill in as the text seemed too big for the box. By the way why not just use a _blank url link from the main swf to the forms page?

Last edited by Stoke Laurie; 12-18-2006 at 05:38 PM.
Stoke Laurie is offline   Reply With Quote
Old 12-18-2006, 06:17 PM   #12
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
Quote:
Originally Posted by Stoke Laurie
Excellent glad you found the answer. Tried the form very good.
If I were you I would check the point size or the size of the text fields that you fill in as the text seemed too big for the box. By the way why not just use a _blank url link from the main swf to the forms page?
I did that but it just opens a new window and not a specific sized window.
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-18-2006, 10:31 PM   #13
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
Quote:
Originally Posted by Stoke Laurie
Excellent glad you found the answer. Tried the form very good.
If I were you I would check the point size or the size of the text fields that you fill in as the text seemed too big for the box. By the way why not just use a _blank url link from the main swf to the forms page?
Fixed the text boxes and now the form opens correctly. I hope you have a chance to check it out again.
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-20-2006, 12:09 PM   #14
Stoke Laurie
That web bloke
 
Stoke Laurie's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 869
Yep works fine now well done.
Stoke Laurie is offline   Reply With Quote
Old 12-20-2006, 01:15 PM   #15
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
Check out the Profiles Folder - The data isn't there yet but the graphics and animation are...What do ya think?
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:18 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.