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

General discussions related to php

Moderators: macek, egami, gesf

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

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

Postby MaxDax » 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: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

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

Postby swirlee » 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?

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

Postby Redcircle » 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

Postby MaxDax » 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


Return to “PHP General”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest