Jump to content

Auto Determine Page Height?


cheezylu

Recommended Posts

This is probably a stupid question, but I'm curious to know if there is a way to automatically determine the height of each page?

 

I asking because I have a site with a main body column and a side column and hate it when there is blank space vertical on one side of the other just because the content of one of the columns is larger than the other.  I was hoping if there is a way to determine how tall the page is then I could create a PHP formula to include a certain number of content features along the side column based on the page height.  Perhaps there's a different way to do this... any ideas?

Link to comment
https://forums.phpfreaks.com/topic/38313-auto-determine-page-height/
Share on other sites

I'm curious to know if there is a way to automatically determine the height of each page?

 

No there is not, and even if there was it would have nothing to do with php. PHP doesn't know what a page is, it just outputs strings that most people happen to format as html.

Thanks!  It seems to be working great!

 

In case anyone is curious, this is what I have done...

 

<?php
$articleSize = strlen($article); // # of characters in the article
$featureSize = 650; // approx. # of article characters that equal the height of the average featured item
$featureEq = $articleSize/$featureSize;
$featureQty = round($featureEq); //# of features to post

$i=1;

while( $i <= $featureQty ){

echo "\<?php include 'feature$i.php' ?\><br/>";

$i++;
} //end of while
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.