# Send data to PHP without page refreshing

**URL:** https://forum.kirupa.com/t/send-data-to-php-without-page-refreshing/241193
**Category:** Uncategorized
**Created:** [October 10, 2007, 7:58pm UTC](https://forum.kirupa.com/t/send-data-to-php-without-page-refreshing/241193 "2007-10-10T19:58:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jimjamjo1](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jimjamjo1](https://forum.kirupa.com/u/jimjamjo1)
#### Post date: [October 10, 2007, 7:58pm UTC](https://forum.kirupa.com/t/send-data-to-php-without-page-refreshing/241193/1 "2007-10-10T19:58:26Z")

</div>

Hello, I have some code used to generate a JPG of a movieclip, which works well but it opens a new window initialize the php script.

I would like it to be so that the php is completed without the page updating or any new windows opening.

My code is as follows:

Code:

\_root.onMouseDown=function(){  
snap=new flash.display.BitmapData(cam.\_width, cam.\_height,true,0);  
snap.draw(cam);  
pixels=new Array();  
w=snap.width;  
h=snap.height;  
for(a=0;a\<=w;a++) {  
for(b=0;b\<=h;b++) {  
tmp=snap.getPixel(a,b).toString(16);  
pixels.push(tmp);  
}  
}  
snap.destroy();  
output=new LoadVars();  
output.img=pixels.toString();  
output.height=h;  
output.width=w;  
output.send(‘capture.php’, ‘output’, ‘POST’);  
};  
stop();

Thanks for any help
