Hi Rhyan and kkeith29.
Thanks for the replies. kkeith yes I am overwriting $to_write just as a temporary troubleshooting aid.
Rhyan I tried changing the code to this (The old code is commented out to let you know whats changed):
ob_start(); // start buffer
include ('../php_includes/sidebar_search_flight.php');
//$flight = ob_get_contents(); // assign buffer contents to variable
//ob_end_clean(); // end buffer and remove buffer contents
$flight = ob_get_flush();
However this doesn't work as the included file is output as content and displayed in the browser window and th ejavascript file is not created.
I'm going to try and put the content held int he include file directly in the code and escape every quote I need to and I'll see if that works, but if you have any other ideas please let me know as i really want to keep the content separated and not have to escape everything.
Many thanks,
Richard
EDIT; there are no PHP errors being output either. using the first code is is just a blank page (which is good as I will be using it with a CRON job) or with the modified code the include file is output.
Last edited by rickya100; Nov 21st, 2008 at 5:47 am. Reason: Forgot some information