Re: header problem

Wayn0 <[email protected]> Wed, 19 Sep 2007 17:02:46 +0200
Newsgroups gmane.text.rlib.user
Message-ID <[email protected]>
Michiel Betel wrote:
> Hi Wayn0
> 
> Add the following....
> 
> $my_header = split("\n", rlib_get_content_type($rlib));
> foreach($my_header as $x) {
>     if($x != '')
>         header($x);
> }
> 
> Michiel
> 
> Wayn0 wrote:
>> Wayn0 wrote:
>>  
>>> Good day
>>>
>>> I have recently installed rlib and it looks great, I have been 
>>> messing about with the examples in the documentation but I am running 
>>> into a little problem.
>>>
>>> when I use the example in the pdf book to generate pdf or csv output 
>>> I receice the following error.
>>>
>>> *Warning:* Header may not contain more than a single header
>>>
>>> I am using the PHP bindings by the way.
>>>
>>> Any help would be greatly appreciatted
>>>
>>> Thank you,
>>> Wayn0
>>>
>>>     
>>
>> just a bit more info
>>
>>
>> Warning: Header may not contain more than a single header, new line 
>> detected. in /var/www/localhost/htdocs/report.php on line 15
>>
>> <? dl ("rlib.so");
>>
>> $format = $_GET['format'];
>> $sql_host = "localhost";
>> $sql_users = "root";
>> $sql_password = "Password1";
>> $sql_database = "sandbox";
>>
>> $rlib = rlib_init();
>>    rlib_add_datasource_mysql($rlib, "mysql", $sql_host, $sql_users, 
>> $sql_password, $sql_database);
>>    rlib_add_query_as($rlib, "mysql", "select * from example", "example");
>>    rlib_add_report($rlib, "report.xml");
>>    rlib_set_output_format_from_text($rlib, $format);
>>    rlib_execute($rlib);
>>    header(rlib_get_content_type($rlib));
>>    rlib_spool($rlib);
>>    rlib_free($rlib);
>> ?>
>>
>> line 15 header(rlib_get_content_type($rlib));
>>

Thanks Michiel,

just realised wha the problem was and solved it with

header(urlencode(rlib_get_content_type($rlib)));

thanks
Wayne Oliver

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/