# Send contact form thru php opens new window =/

**URL:** <https://forum.kirupa.com/t/send-contact-form-thru-php-opens-new-window/185337>\
**Category:** Uncategorized\
**Created:** [April 12, 2006, 3:40pm UTC](https://forum.kirupa.com/t/send-contact-form-thru-php-opens-new-window/185337 "2006-04-12T15:40:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)\
**Post date:** [April 12, 2006, 3:40pm UTC](https://forum.kirupa.com/t/send-contact-form-thru-php-opens-new-window/185337/1 "2006-04-12T15:40:56Z")

</div>

```auto

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](http://lolomedia.com/radio.html)

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

---

<div class="post-metadata">

**Author:** ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)\
**Post date:** [April 12, 2006, 5:19pm UTC](https://forum.kirupa.com/t/send-contact-form-thru-php-opens-new-window/185337/2 "2006-04-12T17:19:14Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![FizixMan](https://avatars.discourse-cdn.com/v4/letter/f/e9c0ed/32.png) [@FizixMan](https://forum.kirupa.com/u/FizixMan)\
**Post date:** [April 12, 2006, 6:49pm UTC](https://forum.kirupa.com/t/send-contact-form-thru-php-opens-new-window/185337/3 "2006-04-12T18:49:33Z")

</div>

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.

```auto

<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!

---

<div class="post-metadata">

**Author:** ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)\
**Post date:** [April 12, 2006, 6:56pm UTC](https://forum.kirupa.com/t/send-contact-form-thru-php-opens-new-window/185337/4 "2006-04-12T18:56:35Z")

</div>

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

i tried using this:

```auto

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](http://domain.com)… not cool! :hair:

---

<div class="post-metadata">

**Author:** ![FizixMan](https://avatars.discourse-cdn.com/v4/letter/f/e9c0ed/32.png) [@FizixMan](https://forum.kirupa.com/u/FizixMan)\
**Post date:** [April 12, 2006, 7:37pm UTC](https://forum.kirupa.com/t/send-contact-form-thru-php-opens-new-window/185337/5 "2006-04-12T19:37:34Z")

</div>

■■■■, 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](http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html)

---

<div class="post-metadata">

**Author:** ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)\
**Post date:** [April 12, 2006, 7:43pm UTC](https://forum.kirupa.com/t/send-contact-form-thru-php-opens-new-window/185337/6 "2006-04-12T19:43:09Z")

</div>

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.
