Screenwidth in php?
- blah569
-
blah569
- Member since: Jan. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 25
- Programmer
I know how to do that in JS (screen.width), but how do I assign that to a php variable? Please help. Thanks.
- blah569
-
blah569
- Member since: Jan. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 25
- Programmer
I solved it, but I have another question.
So, why doesn't this stretch the table to the width of my resolution? This is what I am using:
<table align='center' height='22' width='$width' cellspacing='1' bgcolor='orange'>
<td bgcolor='black'>
$width
</td>
</table>
It only fits the text, it doesn't stretch to my screen width.
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
Just change width='$width' to width='100%'
And it looks like you're tryign to display the width too because you have:
<td bgcolor='black'>
$width
</td>
Just use the javascript there to output that.
- authorblues
-
authorblues
- Member since: Jun. 21, 2005
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
At 5/20/07 06:23 PM, JeremysFilms wrote: Just use the javascript there to output that.
if youve already got the variable in memory, why not just use it there?
it would take more work to get it in php, and then get it again in js...
... kids!
- blah569
-
blah569
- Member since: Jan. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 25
- Programmer
At 5/20/07 06:23 PM, JeremysFilms wrote: Just change width='$width' to width='100%'
And it looks like you're tryign to display the width too because you have:
<td bgcolor='black'>Just use the javascript there to output that.
$width
</td>
Thanks, that 100% did exactly what I needed!


