Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
yself #1
Contact Form (php) - how to prevent new window
My contact form works just fine, however, I currently have the target set to
"_blank" which is not what I want.
Rather than opening the .php file open in a new window, I just want to go to a
new frame (labeled "success" or "error") within my flash file (which currently
works fine)
So, my question is how do I send the form information to my php file WITHOUT
having to open a new window outside of my flash file since I'm sending the user
to new frame instead.
FYI: I've already tried removing "_blank" but it still opens the php file in a
new browser window.
My code below:
on (release){
var my_lv:LoadVars = new LoadVars();
my_lv.fullName = fullName_txt.text;
my_lv.email = email_txt.text;
my_lv.emailMessage = emailMessage_txt.text;
if(fullName_txt.text != "" && email_txt.text != "" && emailMessage_txt.text
!= "") {
my_lv.send("contact.php","_blank","POST");
gotoAndStop("success");
}
else {
gotoAndStop("error");
}
}
Any help is greatly appreciated.
Yvonne
yself Guest
-
contact form
Can anyone help me. I have a contact form on my site it works ok when anyone submits the form and the confirmation page opens ok. The prob I have... -
Contact form with DateField
I hope someone can help me with this because I can't get it to work myself. I have created an contact form with Flash and in this form there is a... -
Contact Us Form
Can somebody please give me a simple script for a form that is going to be sent to design@netzed.co.uk. Has a text field for contact name, email... -
PHP and contact form
I'm a virgin at PHP, so go easy. :) I have a contact form and a separate PHP script that I'm attempting to author. I have no problem with it... -
Prevent scroll in parent window?
My page consists of a large graphic (an organization chart). I'm using an image map with hotspots to allow the user to click on any node of the... -
Motion Maker #2
Re: Contact Form (php) - how to prevent new window
Sounds like the PHP contact.php is sending back whitespace (tabs, spaces,
returns), text or html.
--
Lon Hosford
[url]www.lonhosford.com[/url]
May many happy bits flow your way!
"yself" <webforumsuser@macromedia.com> wrote in message
news:e57l4g$cma$1@forums.macromedia.com...
My contact form works just fine, however, I currently have the target set to
"_blank" which is not what I want.
Rather than opening the .php file open in a new window, I just want to go
to a
new frame (labeled "success" or "error") within my flash file (which
currently
works fine)
So, my question is how do I send the form information to my php file
WITHOUT
having to open a new window outside of my flash file since I'm sending the
user
to new frame instead.
FYI: I've already tried removing "_blank" but it still opens the php file
in a
new browser window.
My code below:
on (release){
var my_lv:LoadVars = new LoadVars();
my_lv.fullName = fullName_txt.text;
my_lv.email = email_txt.text;
my_lv.emailMessage = emailMessage_txt.text;
if(fullName_txt.text != "" && email_txt.text != "" &&
emailMessage_txt.text
!= "") {
my_lv.send("contact.php","_blank","POST");
gotoAndStop("success");
}
else {
gotoAndStop("error");
}
}
Any help is greatly appreciated.
Yvonne
Motion Maker Guest
-
dParser #3
Re: Contact Form (php) - how to prevent new window
Encapsulating the code into three functions will make it easier to debug,
try this:
//Begin ActionScript:
on(release){
doCheck();
}
function doCheck(){
if(fullName_txt.text != "" && email_txt.text != "" && emailMessage_txt.text
!= "") {
doSendLoad();
} else {
gotoAndStop("error");
}
}
function doSendLoad(){
var mysend_lv:LoadVars = new LoadVars();
var myload_lv:LoadVars = new LoadVars();
mysend_lv.fullName = fullName_txt.text;
mysend_lv.email = email_txt.text;
mysend_lv.emailMessage = emailMessage_txt.text;
myload_lv.onLoad = function(success) {
if(success){
if(this.nResult == "Fail"){ //here "this" refers to myload_lv, I used
"nResult" so as not to muddy up a Flash keyword
gotoAndStop("error");
} else {
//you could also load in more info here using "this.someOtherVar1"
or "this.someOtherVar2" (see below)
gotoAndStop("success");
}
}
}
mysend_lv.sendAndLoad("contact.php", myload_lv, "POST"); //you have to use
sendAndLoad if you want to receive info
}//end ActionScript
//Begin PHP:
//do the database hookup
//do the database query
//if the query fails
print("&nResult=Fail");
exit;
//if the query is a success, you could send more info back
$moreInfo1 = someQueriedInfo1;
$moreInfo2 = someQueriedInfo2;
print("&nResult=OK&someOtherVar1=$moreInfo1&someOt herVar2=$moreInfo2");
//etc....
exit;
//end PHP
//It can be frustrating to get this working the first time, but this should
point you in the right direction.
richard
"Motion Maker" <macromedia@osfordusahay.com> wrote in message
news:e5kf9a$7on$1@forums.macromedia.com...to> Sounds like the PHP contact.php is sending back whitespace (tabs, spaces,
> returns), text or html.
>
> --
> Lon Hosford
> [url]www.lonhosford.com[/url]
> May many happy bits flow your way!
> "yself" <webforumsuser@macromedia.com> wrote in message
> news:e57l4g$cma$1@forums.macromedia.com...
> My contact form works just fine, however, I currently have the target set> "_blank" which is not what I want.
>
> Rather than opening the .php file open in a new window, I just want to go
> to a
> new frame (labeled "success" or "error") within my flash file (which
> currently
> works fine)
>
> So, my question is how do I send the form information to my php file
> WITHOUT
> having to open a new window outside of my flash file since I'm sending the
> user
> to new frame instead.
>
> FYI: I've already tried removing "_blank" but it still opens the php file
> in a
> new browser window.
>
> My code below:
>
> on (release){
> var my_lv:LoadVars = new LoadVars();
>
> my_lv.fullName = fullName_txt.text;
> my_lv.email = email_txt.text;
> my_lv.emailMessage = emailMessage_txt.text;
>
> if(fullName_txt.text != "" && email_txt.text != "" &&
> emailMessage_txt.text
> != "") {
> my_lv.send("contact.php","_blank","POST");
> gotoAndStop("success");
> }
> else {
> gotoAndStop("error");
> }
> }
>
> Any help is greatly appreciated.
>
> Yvonne
>
>
dParser Guest



Reply With Quote

