Upload manager for texteditor!?!

I’m trying to create a upload manager for my texteditor, but need a little help. In my javascript I call a image uploadbox like this:

if (cmd == "insertimage" && !value) {
	  var imageUrl = PopupCenter('http://www.mysite.com/imageupload.php', 'Upload',400,400);
	  if (imageUrl) {
		  this.frame.focus();
		  this.frame.document.execCommand(cmd, false, imageUrl);
		  this.frame.focus();
	  }
}

Now my imageuploap.php should send some values back to this:

 if (imageUrl) {
		  this.frame.focus();
		  this.frame.document.execCommand(cmd, false, imageUrl);
		  this.frame.focus();
	  }

But I’m not sure how to do so… If I just for the ease of it make a inputfield in my imageupload.php like this:

<form action="" method="get">
<input name="imageurl" type="text" />
<input name="Submit" type="submit" />
</form>

How do I pass the value back on submit???

Hope this makes sense and thanks in advance…

Well, mayby I think this could be the way around allthough I can’t get it to work…

myTexteditor.php (javascriptpart)

this.execCommand = function(cmd, value){
	if (cmd == "insertimage" && !value) {
		var imageUrl = PopupCenter('http://www.mysite.com/upload.php', 'Upload',400,400);
		var imgUrl = document.uploadform.imageurl.value;
		if (imgUrl) {
			this.frame.focus();
			this.frame.document.execCommand(cmd, false, imgUrl);
			this.frame.focus();
		}
	} else {
		this.frame.focus();
		this.frame.document.execCommand(cmd, false, value);
		this.frame.focus();
	}
};

upload.php

<form name="uploadform" action="" method="post">
<input name="imageurl" type="text" />
<input name="Submit" type="submit" onClick="insertimage();" />
</form>

What I’m trying to do here is to pass the data back from the upload.php on submission, but I’m not quite doing it right…

Please help me (in the right direction)…