11-28-2003, 12:54 PM
|
#1
|
|
Member
Join Date: Oct 2003
Location: Paris, FRANCE
Posts: 69
|
loadVars.send without the popup browser window?
I'm using very successfully the "loadVars.send()", using the POST method. BUT I did not expect to see a popup browser window!? I can shut it down using another javascript, but get a confirmation message (because I didn't open up that unwanted browser window using js)... Is there any way I can call a loadVars send without the popup browser window?
I am using: myVars.send ("Aurora.php", "POST");
Using: myVars.send("Aurora.php", "_blank", "POST");
or myVars.send ("Aurora.php", "", "POST"); gets me the same pop up window.
Any further help greatly appreciated.
Thanks
__________________
Wild & Innocent
|
|
|
11-28-2003, 02:04 PM
|
#2
|
|
Goldmember
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
|
Loadvars isn't supposed to produce a popup. I think it is a problem with your php
myVars.send ("Aurora.php") should work
Last edited by McGiver; 11-28-2003 at 02:07 PM.
|
|
|
11-28-2003, 02:27 PM
|
#3
|
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
|
If I remember correctly, that send() function has a bug(?) that opens new window... So, I normally use sendAndLoad() function and have the PHP return a dummy string back to Flash so that I can know that the script has been executed...
Oh... I didn't know if it was in 2004 forum... I do not know if that has been fixed or not, but I guess that's the way it is since you asked that question...
|
|
|
11-28-2003, 02:47 PM
|
#4
|
|
Registered User
Join Date: Feb 2003
Location: Bucharest, Romania
Posts: 76
|
maybe i am misunderstanding the issue... but for me the loadvars.send always brought up a popup.
so what i saw as a way of solving the problem was loadvars.load(myurl) where myurl is something like
myurl=www.site.com/page.php?var1=bla&var2=bla
and this always did the trick for me...
|
|
|
11-28-2003, 02:51 PM
|
#5
|
|
Member
Join Date: Oct 2003
Location: Paris, FRANCE
Posts: 69
|
Thank's for your quick answear !
Unfortunetly I have already tried that solution but it's not working. I'm not receiving any email  ...
I have attached my code to make sure you have all parameters !
---------------
...
// this is not an instance button
userData = new LoadVars();
userData.company = company.text;
userData.email = email.text;
// Test of the v2 components
if (company.text eq "" or email.text eq "") {
stop();
} else {
userData.sendAndLoad("ContactC.php", 0, "POST");
gotoAndStop(2);
...
--------------------
Thank you again for your valuable time !
__________________
Wild & Innocent
|
|
|
11-28-2003, 03:00 PM
|
#6
|
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
|
Yes... That will do the job as well, marius...
Averroes... Your sendAndLoad(0 line should be like this...
ActionScript Code:
userData.sendAndLoad("ContactC.php", userData, "POST");
Have your PHP just echo out the text file for the incoming variables rather than running the mail() funciton to make sure that you are getting the variables right from the Flash...
Maybe you might want to post your PHP script as well if you still cannot fix it...
[useastags]
|
|
|
11-30-2003, 10:48 AM
|
#7
|
|
spend my time in blender
Join Date: Oct 2003
Location: tampa, fl
Posts: 1,138
|
Averroes,
Note: I am using Flash MX
I have been having the same problem as you over the last couple days and saw this thread while searching for a solution. In your first post you did not mention passing the loadVarsObject name like CyanBlue suggested later. this combined with sendAndLoad finally worked for me. example:
ActionScript Code:
loadVarsObject.sendAndLoad("mailer.php", loadVarsObject, "POST");
The solution I was previously using was similar to what marius suggested, however, I utilized the toString method to make things easier for me. The following uses the names of files etc that were in my project.
ActionScript Code:
formVariables = formData.toString;
formData.load("php/dream.php?"+formVariables);
I've learned you have to be extra careful when using loadVars methods along with php's mail function. they often don't want to play nice together.
-splict
On a side note: Wow, my first post. Btw, Thanks CyanBlue - you are often the reason why I find my answers without having to post.
|
|
|
11-30-2003, 11:10 AM
|
#8
|
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
|
Thank you for the helpful information, splict...
Me the reason for not wasting your time??? Then, Um, I'll have to charge you... Wire me 2 cents to my secret Swiss bank account ASAP...
Glad to hear that somebody find that one useful...
I might do some update later if I have time and if I get 2004... No promise on that though...
Just got curious though... You mentioned that LoadVars doesn't get along with the PHP's mail() function... Can you be abit more specific on that???
|
|
|
11-30-2003, 12:09 PM
|
#9
|
|
spend my time in blender
Join Date: Oct 2003
Location: tampa, fl
Posts: 1,138
|
By the way I forgot to mention to make sure all $_POST lines are changed to $_GET in the php file if the 2nd (formData.load) method is used.
CyanBlue: Money's on the way
What I meant by them not getting along isn't that they don't work right - they do of course. The problems are that when sending/loading external variables, etc. I could get away with code that would work fine. However, with mail() in the php file, it would either not send the mail or it would but it wouldn't have the sent variables.
I would then have to go back and make my code more proper (read: correct) to get it to work. If I can go back and replicate the problems later today I will do so and post a sample.
-splict
|
|
|
11-30-2003, 01:10 PM
|
#10
|
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
|
Quote:
|
it would either not send the mail or it would but it wouldn't have the sent variables.
|
Ah... I see... Yeah... As a matter of fact, I've read several threads that goes with mail not working properly...
But all of them turned out that they were not using proper syntax to get the mail working...
If I remember correctly, it wasn't the issue of LoadVars() and mail() specific error though...
Money's on the way??? Yeehaa... I probably can buy another computer before I die...
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 05:55 AM.
///
|
|