Problem Processing JavaScript DHTML Function

I have a desktop software product (Rmsad.exe) that runs as a process in the background. Periodically, Rmsad.exe makes a call to
a .php page (smfeed.php) on my server. One of the parameters it sends over is an URL to load in a DHTML window. Inside smfeed.php,
I call a javascript function that displays the DHTML window:

var googlewin=dhtmlwindow.open("googlebox", "iframe", '<?php echo $outurl2; ?>', "Title text here",
"width=<?php echo $winwd; ?>px,height=<?php echo $winht; ?>px,resize=1,scrolling=1,center=1", "recal")

This is a replacement for calling a basic javascript pop-up window. The script is a slightly expanded version of the one here:

Here’s the layout of the smfeed.php page:

<?php
//Php code that exist here gets properly executed
//
//
?>

<script type="text/javascript" src="deluxe-popup-window.js"></script>
<script type="text/javascript">
var googlewin=dhtmlwindow.open("googlebox", "iframe", '<?php echo $outurl2; ?>', "Title text here", "width=<?php echo $winwd; ?>px,height=<?php echo $winht; ?>px,resize=1,scrolling=1,center=1", "recal")
</script>

<?php
//Php code that exist here gets properly executed
//
//
?>

If you call the smfeed.php page directly, by manually entering it’s URL into a browser address bar, the DHTML window
script (dhtmlwindow.open) works fine. The DHTML window gets displayed. However, when smfeed.php is called from Rmsad.exe,
the window doesn’t load at all. I tried replacing the dhtmlwindow.open statement with a very basic:

<script type="text/javascript">
window.open ('http://www.bing.com')
</script>

statement, just to test with a less complex javascript. It wouldn’t load a window either. Again, both work if calling
smfeed.php directly. There is php code before and after the javascript DHTML call. All the php code gets executed
properly. So I know the entire smfeed.php page is getting processed.

Any ideas why the javascript functions won’t work when contacted by Rmsad.exe?

When you call the php file from your .exe, does the file open in a browser? If not then i don’t see why it would run the javascript anyway. Also most browsers will not run scripts if they aren’t hosted on a web server of some sort.