SunQuest
           Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 1st, 2003, 12:48 PM
PHP_ignoramus PHP_ignoramus is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 8 PHP_ignoramus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 40 sec
Reputation Power: 0
sendAndLoad

hi..

after a long time i have got flash sending variables to a php script, this was my first shot at php and it has been both very confusing and fun.. I am using LoadVars and the sendAndLoad function in flash. The variables are sent from flash to the script and the php mail method is called to send to my email address..

this works ok, however i really would like to show the status by displaying a return string from the php script. When running the code below once the email message is sent the _root.EmailStatus field goes blank but does not show the $send_answer

Here is my code below, if anyone can see why i get no reply from the script?? that would be great!!


php file

<?

//start a msg string
$msg = "This Message Recieved from the Panic Stricken Bovine website:" . "\n";
$msg .= "Sender's Name:\t" . $_POST['name'] . "\n";
$msg .= "Sender's Email:\t" . $_POST['email'] . "\n";

//create a variable for the recipient's email address
$to = "aztechnician@telstra.com";
//The subject of the email
$subject = "WILD THINGS III";


//mail headers
$mailheaders = "From:\t" . $_POST['name'] . "\n";
$mailheaders .= "Reply-To:\t" . $_POST['email'] . "\n";

//mail method
mail($to, $subject, $msg, $mailheaders);

$sendresult = "SUCCESS";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "&$send_answer";
?>


flash button actionscript:
on (release) {
if (!_root.email.length || _root.email.indexOf("@") == -1 || _root.email.indexOf(".") == -1) {
_root.EmailStatus = "Please enter a valid E-mail address";
} else if (!_root.name.length) {
_root.EmailStatus = "Please enter your name";
} else {
scriptVars = new LoadVars();
scriptVars.name = _root.name;
scriptVars.email = _root.email;
scriptVars.sendAndLoad("flash.php", scriptVars, "POST");
_root.EmailStatus = "Sending... one Moment";
scriptVars.onLoad = function() {
_root.EmailStatus = scriptVars.send_answer;
};
}
}

Reply With Quote
  #2  
Old June 1st, 2003, 04:36 PM
CyanBlue CyanBlue is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Chantilly, VA
Posts: 31 CyanBlue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Howdy... I'm just saying hi!!!

I've seend this one somewhere...

Reply With Quote
  #3  
Old June 2nd, 2003, 02:53 PM
rob5408 rob5408 is offline
Certified Genius
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: over there
Posts: 77 rob5408 User rank is Private First Class (20 - 50 Reputation Level)rob5408 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 46 m 57 sec
Reputation Power: 7
Send a message via AIM to rob5408
run thru server??

change...

scriptVars.sendAndLoad("flash.php", scriptVars, "POST");

...to...

scriptVars.sendAndLoad("http://www.myserver.com/flash.php", scriptVars, "POST");

i'm pretty sure you have to run the script thru the server to get the output you expect...
__________________
Delenda est Carthago

Reply With Quote
  #4  
Old June 5th, 2003, 02:29 PM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
You need to change
Code:
scriptVars.onLoad = function() {
_root.EmailStatus = scriptVars.send_answer;
};


to

Code:
scriptVars.onLoad = function() {
_root.EmailStatus = scriptVars.answer;
};


Since the var you want is named answer. Not send_answer. That variable only lives in the PHP script.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > sendAndLoad


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway