basic question: How can I stop truncation of output length

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

basic question: How can I stop truncation of output length

Postby kc11 » Sat Jun 25, 2011 10:50 am

Hi everyone,

This is very basic I'm sure, but as a noob pretty frustrating. I am working with PHP 5.3 and firefox. When the output of my scripts goes to the browser it cuts off after the first few lines and you see ( for example )

Syntax: [ Download ] [ Hide ]
"... (length=145784)"


I would like the full output to be sent to the browser.

I would appreciate any help.

Regards,

KC
kc11
Forum Commoner
 
Posts: 73
Joined: Mon Sep 27, 2010 3:26 pm

Re: basic question: How can I stop truncation of output leng

Postby califdon » Sat Jun 25, 2011 2:02 pm

I'm not clear on what you are seeing. Are you saying that literally those few characters are all that is being received by the browser?? Is this what you see when you look at the Source page in Firefox? Absolutely nothing else? That doesn't look like an error message. When you say that you would like the "full output" to be sent to the browser, what is the full output, HTML and text? XML? binary data? Can you show us a (brief) example of your code?

[Edit: it just occurred to me, are you viewing your PHP script using Firefox on your local computer? What web server are you using to view it with? You are aware, are you not, that PHP is not understood by Firefox, it must be sent to Firefox from a web server such as Apache, which parses the PHP and delivers HTML to the browser.]
Last edited by califdon on Sat Jun 25, 2011 2:08 pm, edited 2 times in total.
Reason: To add my afterthought.
I don't make syntax errors. It's just that sometimes whoever wrote the programming language failed to anticipate my creative coding.
User avatar
califdon
Jack of Zircons
 
Posts: 4484
Joined: Thu Nov 09, 2006 9:30 pm
Location: California, USA

Re: basic question: How can I stop truncation of output leng

Postby Weirdan » Sat Jun 25, 2011 4:38 pm

It looks like you're outputting the data using var_dump() (with xdebug installed). var_dump() is a debugging function and, generally, during debugging it's enough to see just a part of the string. Use echo() if you want to output entire string.
User avatar
Weirdan
Moderator
 
Posts: 5889
Joined: Mon Nov 03, 2003 7:13 pm
Location: Odessa, Ukraine

Re: basic question: How can I stop truncation of output leng

Postby kc11 » Sat Jun 25, 2011 8:06 pm

Hi Guys,

Thank you both for taking the time to reply. Califdon, I should have been clearer. I am trying to print out HTML, Sorry. Weirdan, you were entirely correct. Changing to echo from var_dump prints out the entire page in my browser.

This helps a lot.

Thanks again,

KC
kc11
Forum Commoner
 
Posts: 73
Joined: Mon Sep 27, 2010 3:26 pm

How can I stop truncation of output length

Postby alanpoly » Fri Jan 27, 2012 7:13 am

Thank you both for taking the time to reply. Califdon, I ought to have been clearer. I am trying to print out HTML, Sorry. Weirdan, you were completely accurate. Changing to resonance from var_dump prints out the whole page in my browser
alanpoly
Forum Newbie
 
Posts: 1
Joined: Fri Jan 27, 2012 7:02 am


Return to Testing

Who is online

Users browsing this forum: No registered users and 3 guests