[Resin-interest] header('Location: $url') in quercus ..

2010-12-03 Thread DL
I have integrated quercus into another tomcat webapp - orbeon - which is an 
xforms server.

I am trying to use the quercus servlet integrated with orbeon servlet to 
dynamically write 
xhtml files immediately before they are run by the orbeon xforms server

one way I'm trying is to use quercus php to write *.xhtml format into an xforms 
sandbox

and then after creating the file redirect browser to run the freshly created 
xhtml file.

this code below works when tested separately in Apache php server.

A simple text string (later to be more complex xhtml format) is written into a 
file in another 
directory .. and then browser should redirect to $url 

.. but why does this not redirect in quercus?

It seems that header('Location: $url'); is not working in quercus.

[code]
?php
$your_data = This is test string written to myfile.xhtml;
$directory = ../path-to-file-directory/;
$filename = myfile.xhtml;
$fp = fopen($directory.$filename, w);
fwrite($fp, $your_data);  // this file create works o.k. in quercus
fclose($fp);
$url = 'http://www.google.com';
header('Location: $url');  // this is not working in quercus 
embedded in orbeon
exit(); 
?
[/code]

dl
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] header('Location: $url') in quercus ..

2010-12-03 Thread Scott Ferguson
DL wrote:
 A simple text string (later to be more complex xhtml format) is 
 written into a file in another directory .. and then browser should 
 redirect to $url

 .. but why does this not redirect in quercus?

 It seems that header('Location: $url'); is not working in quercus.

You need to use double quotes in PHP to get variable interpolation:

  header(Location: $url);

Single quoted strings don't interpolate variables.

-- Scott

 [code]
 ?php
 $your_data = This is test string written to myfile.xhtml;
 $directory = ../path-to-file-directory/;
 $filename = myfile.xhtml;
 $fp = fopen($directory.$filename, w);
 fwrite($fp, $your_data);  // this file create works o.k. 
 in quercus
 fclose($fp);
 $url = 'http://www.google.com';
 header('Location: $url');  // this is not working in 
 quercus embedded in orbeon
 exit();
 ?
 [/code]

 dl
 

 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
   



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest