Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser Question.... 1

Status
Not open for further replies.

colep

Programmer
Jul 18, 2002
58
US
I'm not sure where to post this question, but here goes...

Does anyone know what causes the browser to misinterpret the html/php code?? What I mean is sometimes you will pull up a page and the text will be overlying on an image (like it's ignoring the table structure). But when you refresh the page, it appears as it should. Is there anyway to fix this type of a thing??? Just curious.

Cole ;)
 
Here's one thought....

In your specific case, I could see where if the "height" and "width" attributes of the IMG tag are wrong, then the browser's rendering engine could superimpose text. The browser uses those attributes to reserve space for the graphic on the page while it fetches the graphic in a separate communication with the web server.

When you refresh, the browser pulls the HTML and image from cache. It can then reserve the correct space on the page because it can detect that proper height and width of the graphic from the cached file as it renders. ______________________________________________________________________
TANSTAAFL!
 
No browser should ever interpret any of you php code, since PHP is a serverside scripting language it is always interpreted/executed on the server (in case the server is configured corretly). HTML however and also Javascript are clientside and thus interpreted on the client/browser.

The effect you are describing can have various reasons ranging from invalid HTML code to interrupted/partial transmission or a misbehaving browser. For me it often helped to clear the cache and restart the browser.

Zod
 
Hi,

You might want to check your html <!DOCTYPE > tag.
I was having a problem where on IE5, the content of my table are view correctly as how I wanted, but on IE6, the content did not wrap within the table column and the column expanded very wide.

If possible you can try to remove the DOCTYPE tag and see if the output is correct in the table then try your DOCTYPE tag again.

Regards.
 
Thanks for the helpful explanation. I really haven't been able to define the images height and width beings the image name is being pulled in from a database (so I don't know what the height and width is beings it's dynamic). Athough I did some research and found the getimagesize() function which will give me the images height and width so I can allocate the space needed for the image. Thanks for your help again.

Cole ;)
 
I have an application where the filename for an image is kept in a MySQL database. What I've done is when the user uploads an image and its record is placed in the database, I run getimagesize() then, and include the height and width as columns in the table.

That way, the function only has to be run once for each image file. ______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top