Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

determine lenth of page
this may be a real silly question

is there a way to detirmine the lenth of a resulting html page while the
page is still in the output buffer before sending it to the brouser ??

thanks




Report this thread to moderator Post Follow-up to this message
Old Post
chris
12-27-04 01:55 PM


Re: determine lenth of page
No. The length of the resulting page is determined by the resolution on the
client's PC. As the browser window is resized so is the text within it, so
as the window becomes narrower it also becomes longer. The whole point of
HTML is that the client decides on the page size, not you.

--
Tony Marston

http://www.tonymarston.net



"chris" <someone@here.com> wrote in message
news:41cfbea0$1@funnel.arach.net.au...
> this may be a real silly question
>
> is there a way to detirmine the lenth of a resulting html page while the
> page is still in the output buffer before sending it to the brouser ??
>
> thanks
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Tony Marston
12-27-04 01:55 PM


Re: determine lenth of page
Tony Marston wrote:
 

> No. The length of the resulting page is determined by the resolution
> on the client's PC. As the browser window is resized so is the text
> within it, so as the window becomes narrower it also becomes longer.
> The whole point of HTML is that the client decides on the page size,
> not you.

And also the fonts and size preferences of the browser also cause the
page to be longer or shorter.

When I read your question I thought you might also mean the size (in
bytes) of the page, as opposed to the "length" (ie how long the page
is). You can do this with PHP using the output buffering functions.

If this is what you were meaning then take a look at the following
manual page which has an example of how to do this:
http://www.php.net/manual/en/function.ob-get-length.php

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Chris Hope
12-27-04 01:55 PM


Re: determine lenth of page
With the help of style sheets and fixed text area width you can achieve
95% visitors will see your page the same way. If you'll use fixed width
font, you can determine where the lines will break.
So, generally, it is possible, but very limited in possibilities.


Report this thread to moderator Post Follow-up to this message
Old Post
avs
12-27-04 01:55 PM


Re: determine lenth of page
ob_start();
// Put what you want to output
$my_page = ob_get_contents();
ob_end_clean();
$my_page_size = strlen($my_page);

header("Content-length:$my_page_size");
echo $my_page;

I think its what you're searching ..
++Drill


Report this thread to moderator Post Follow-up to this message
Old Post
Drill
12-27-04 08:55 PM


Re: determine lenth of page
ob_start();
// Put what you want to output
$my_page = ob_get_contents();
ob_end_clean();
$my_page_size = strlen($my_page);

header("Content-length:$my_page_size");
echo $my_page;

I think its what you're searching ..
++Drill


Report this thread to moderator Post Follow-up to this message
Old Post
Drill
12-27-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:31 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.