Welcome Guest, Not a member yet? Register   Sign In
2 trailing [EDIT:] leading whitespaces in output
#11

[eluser]mradlmaier[/eluser]
slowgary,

I determine the 2 white space by selecting the complete output in source view. You will not see them in browser view.
The third-party app visiting expects, to have a 0, 1, 2, 3, 4, 5, 6, 7 returned, as the result of my method. As the third-pasty app fails, i suppose the 2 trailing white spaces are the problem. No AJAX involved, not even a single HTML tag, just these codes. Not more, not less.
That seems to be a small thing, but IMHO this would be a serious flaw. IN ASP, Java or whatever i used in my work before, i had complete control over the output.
What makes things worse, it is not possible to bend the third-party app. So I have to make CI behave correctly...

Any ideas?

Thanks,
Michael
#12

[eluser]mradlmaier[/eluser]
TheFuzzyOne,

Sorry, english is not my mother tongue. I suppose, i meant leading spaces, like ' 0'

Michael
#13

[eluser]bcorcoran[/eluser]
Might you try re-downloading and re-installing code igniter? Maybe one of the files has whitespace at the beginning of the file.

Also make sure your view files don't have any whitespace as well.
#14

[eluser]slowgary[/eluser]
You do have complete control over your output in both PHP and CodeIgniter. I haven't seen this problem ever myself, so it sounds like maybe there's something doing it in your code.

Maybe try posting your controller and view or something.
#15

[eluser]mradlmaier[/eluser]
This happens even when i don`t use view files, but use

$this->output->set_output('0');

But if you suspect it is somehow corrupted CI installation, can you try

$this->output->set_output('0');

on your machine and examine the output?

Thanks,
Michael
#16

[eluser]mradlmaier[/eluser]
Reinstalling CI (except my application folder) did not fix the issue.

slowgary,

That`s my controller:

Quote:<?php
class Users extends Controller {
function Users()
{
parent::Controller();
}

function process_chat_login()
{
//@TODO implement processing of chat login
$data = array();
$data['result'] = 1;
$login = array();
$login[0] = $_GET['username'];
$login[1] = $_GET['password'];
if($this->auth->process_login($login))
{
$data['result'] = 0;
}
$this->load->view('login_chat_view', $data);
}

}
?>

And that`s the view:

Code:
<?php echo $result; ?>

As I already mentioned using

Code:
$this->output->set_output($data['result']);

instead of a view would not help.
Using string literals instead of numbers yielded the same: 2 leading spaces.

Michael
#17

[eluser]mradlmaier[/eluser]
Do you have 2 leading white spaces in your output in your CI apps?

I was always assuming I have full control of my output in CI, but because of this issue i checked other pages and they all have 2 leading white spaces.

Michael
#18

[eluser]slowgary[/eluser]
I cannot reproduce your leading whitespace no matter what I try. I view the source using firefox, then hit ctrl+a to select all, but only the character '0' is present. Are you using a language pack other than English? Do you have the site live so we can take a look?
#19

[eluser]mradlmaier[/eluser]
slowgary,

Unfortunately, the site is not online yet. I am using plain CI 1.7.0, no language packs whatsoever. Linuxbox, openSUSE 11.0, LAMP

Michael
#20

[eluser]mradlmaier[/eluser]
slowgary,

That all is bothering me, because if nobody can reproduce it, what i am supposed to do?
Ignoring it, and hoping the problem will disappear, when going live?
Or investing more time and energy in finding a solution for a problem, which might only exist on my box?
This is a mess, and up to now i was enjoying Codeigniter so much...

:-(

Michael




Theme © iAndrew 2016 - Forum software by © MyBB