Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

browser size can be echoe'd but not edited in PHP?

images php coding issues or problems here.

Moderators: macek, egami, gesf

browser size can be echoe'd but not edited in PHP?

Postby Gaurav » Wed Sep 07, 2011 1:01 am

Hi, I am currently trying to plan the Explorer layout for adding some GIF images. I am able to query the height and width of the explorer using JS, below commands:

HEIGHT:
$height = '<script type="text/javascript">
if (window.innerHeight) //if browser supports window.innerWidth
document.write(window.innerHeight)
else if (document.all) //else if browser supports document.all (IE 4+)
document.write(document.body.clientHeight)
</script>';

WIDHT:
$width = '<script type="text/javascript">
if (window.innerWidth) //if browser supports window.innerWidth
document.write(window.innerWidth)
else if (document.all) //else if browser supports document.all (IE 4+)
document.write(document.body.clientWidth)
</script>';

Now if I run
echo "width<br>"; <-- It returns the correct width of the explorer.

But if I do an edit to this value in the PHP code, for example:
$width = $width - 200;
echo "$width<br>"; <-- This returns - 200
Gaurav
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Sep 07, 2011 12:48 am

Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.