Send contact form thru php opens new window =/


stop();

submitBtn.onRelease=function(){
      onSubmit();
}


function onSubmit() {
    formData = new LoadVars();    
    
    formData.Smessage = Smessage.text; 
    formData.gender = genderGroup.getValue(); 
    formData.send("radio.php",0,"POST");
    gotoAndStop(2);
}

this is my result
http://lolomedia.com/radio.html

any advice on this?.. thank you! :jail:

Please guys help me out here.

When I press the submit button on my contact form, my php works great on my email but when you click submit, it opens up a new windown.

please help! :hr:

It sends the data to a PHP page in the browser. It targets that page just like a normal HTML hyperlink would. In this case, you’re using a target of “0”. So it’s looking for a browser window with the name “0”. Since there is none, it opens a new window.

I use a PHP system myself for data send/receive, and I don’t know if it’s the best way but this is how I did it:

Within the HTML page that contains the Flash .swf file, I also included a 1x1 inset frame (<iframe>) with a target name.


<iframe src="" name="php" width="1" height="1" frameborder="0"></iframe>

Now whenever you send/retrieve data from PHP, have it target “php” so it’ll load in the 1x1 (hopefully without notice; give it the same background colour as your page) pixel frame.
[FONT=Courier New][LEFT] ActionScript Code:
[FONT=Courier New][LEFT]formData.[COLOR=#0000FF]send[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“radio.php”[/COLOR], [COLOR=#FF0000]“php”[/COLOR], [COLOR=#FF0000]“POST”[/COLOR][COLOR=#000000])[/COLOR];
[/LEFT]
[/FONT]

[/LEFT]
[/FONT] Hope this helps!

hehe, that’s very neat and sneaky!.. I see perfectly what you mean.

i tried using this:


stop();

submitBtn.onRelease=function(){
      onSubmit();
}


function onSubmit() {
        
    Smessage = Smessage.text; 
    gender = genderGroup.getValue(); 
    loadVariables("radio.php",this,"POST");
    gotoAndStop(2);
}

it loads great without opening a new window this time. so its doing the work. BUT :hitman2: on the very bottom still says :transferring data from domain.com… not cool! :hair:

■■■■, I like the “this” even better… >.>

But yeah, I don’t know if you can get past the transfering data message this way. You might be able to use JavaScript to set the status bar text to whatever you want, but I don’t think you can change the blue loading bar.

But on the other hand, I like having it there because it lets me know when the saving/loading is completed because if I make another call to the scripts before the transaction is completed, I might lose data.

EDIT: oh, you could have your flash movie play in a chromeless window; one that doesn’t have a status bar. You can do so with the JavaScript method window.open()
http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html

another great idea of yours! :thumb2:

even when you submit this… while transferring data, i already receive my email so i don’t think you would be losing data. after 5 minutes or so it will say “Done” on the bottom so that’s good!.

hehe.