Creating link that opens in a re-sized window
Moderator: General Moderators
Creating link that opens in a re-sized window
I have a page that I am working on, its a form, but it doesn't take up the whole page. So it looks real corny when it takes up 1/4 of a page and the rest is just background. Is there an easy way in php/html/javascript to make a link open in a window that resizes based on content?
- puckeye
- Forum Contributor
- Posts: 105
- Joined: Fri Dec 06, 2002 7:26 pm
- Location: Joliette, QC, CA
- Contact:
Hi again,
AFAIK PHP doesn't have any way to correctly guess the width and height that text and form components will take.
Also PHP doesn't affect window size in any way because all PHP parsing is done before the users even receives the page on his/her browser.
The only way that PHP could remotely assign a wdith and height is that if you create a pop-up to show an image, PHP can get the correct w/h using getimagesize() and then could "pass" those values to JavaScript in a way similar to this:
PHP isn't actually passing anything to JavaScript it's just writing the JavaScript code and adding the appropriate value at the appropriate place.
EDIT: Corrected the function name get_image_size() to getimagesize()
AFAIK PHP doesn't have any way to correctly guess the width and height that text and form components will take.
Also PHP doesn't affect window size in any way because all PHP parsing is done before the users even receives the page on his/her browser.
The only way that PHP could remotely assign a wdith and height is that if you create a pop-up to show an image, PHP can get the correct w/h using getimagesize() and then could "pass" those values to JavaScript in a way similar to this:
Code: Select all
print "
<SCRIPT>
window.open = ("file", "name", "height=$height,width=$width");
</SCRIPT>
";EDIT: Corrected the function name get_image_size() to getimagesize()
Last edited by puckeye on Mon Jan 27, 2003 5:28 pm, edited 1 time in total.