|
|
|
#1 |
|
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");
};
clanrequest.php PHP Code:
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials ![]() -------------------------------------------------- What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape |
|
|
|
|
|
#2 |
|
That web bloke
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"; } ?> |
|
|
|
|
|
#3 |
|
KoolMoves Moderator
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"); }; |
|
|
|
|
|
#4 | |
|
Senior Member
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
|
Quote:
__________________
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. |
|
|
|
|
|
|
#5 |
|
That web bloke
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.
__________________
Blog E-commerce example Quality hosting michael jackson tribute candles here Koolmoves support site Last edited by Stoke Laurie; 12-17-2006 at 05:31 PM. |
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
|
Quote:
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 |
|
|
|
|
|
|
#7 |
|
KoolMoves Moderator
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.
|
|
|
|
|
|
#8 |
|
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 |
|
|
|
|
|
#9 |
|
That web bloke
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.
|
|
|
|
|
|
#10 |
|
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");
Code:
_root.gotoAndPlay("thanks');
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. |
|
|
|
|
|
#11 |
|
That web bloke
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?
__________________
Blog E-commerce example Quality hosting michael jackson tribute candles here Koolmoves support site Last edited by Stoke Laurie; 12-18-2006 at 05:38 PM. |
|
|
|
|
|
#12 | |
|
Senior Member
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
|
Quote:
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials ![]() -------------------------------------------------- What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape |
|
|
|
|
|
|
#13 | |
|
Senior Member
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
|
Quote:
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials ![]() -------------------------------------------------- What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape |
|
|
|
|
|
|
#14 |
|
That web bloke
Join Date: Jan 2006
Location: England
Posts: 869
|
Yep works fine now well done.
|
|
|
|
|
|
#15 |
|
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 |
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|