How do I get <div> co ordinates into PHP variables?

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
User avatar
MaxDax
New php-forum User
New php-forum User
Posts: 10
Joined: Tue Oct 07, 2003 5:04 am

Wed Oct 15, 2003 2:03 pm

Hi

I want to find the left hand corner coordinates of a table in code like this -
<center>
<div name="mytable">
<table width="650px">
... table rows etc ...
</table>
<div>
</center>
How do I get the top left hand corner coordinates of the table (or <div>) into PHP variables?

Thanks
MaxDax

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Wed Oct 15, 2003 2:54 pm

MaxDax wrote:How do I get the top left hand corner coordinates of the table (or <div>) into PHP variables?


You'd have to employ some ugly JavaScript. What are you trying to do that you need this in your PHP script?
Image

User avatar
Redcircle
Moderator
Moderator
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Wed Oct 15, 2003 2:57 pm

Becasue PHP is server side I'm not sure those variables will do you any good. If you really need that info would need to get the screen dimensions with javascript, subtract the width from the screen resolution and divide by 2 this will be the left. You really wouldn't beable to get the top because the height is not vertically aligned in the center and the height is not defined.

User avatar
MaxDax
New php-forum User
New php-forum User
Posts: 10
Joined: Tue Oct 07, 2003 5:04 am

Thu Oct 16, 2003 1:03 am

Hi
I keep forgetting that the PHP gets processed before it gets sent to their browser.

Guess I will have to use javascript. What I'm trying to do is use CSS positioning and a centered web page.

I will have to experiment further.

Thanks guys
Maxdax

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests