joebudden Posted January 21, 2007 Share Posted January 21, 2007 hi guys iv got a list of items in a table. when u click the item it goes to another page taking the id with it which displays the information for that item.[code]<a href="information.php?id=<?php echo $r[$id];?>" target="_blank">[/code]this line of code opens the link in a new window but is there anyway i can control the size of it??? Link to comment https://forums.phpfreaks.com/topic/35032-opening-hyper-link-with-get-variables-in-new-window/ Share on other sites More sharing options...
mattd8752 Posted January 21, 2007 Share Posted January 21, 2007 That would be javascript. As to javascript I can't help you, but if you search for a pop-up generator and just use a bit of JS from what it generates it would work fine. Link to comment https://forums.phpfreaks.com/topic/35032-opening-hyper-link-with-get-variables-in-new-window/#findComment-165222 Share on other sites More sharing options...
joebudden Posted January 21, 2007 Author Share Posted January 21, 2007 cheers mattyer iv tried stuff to do with java script, but all i keep finding is to do with buttons.this not what i need as the values for my hyperlinks are generated dynamicallyI'l keep searchin but if any1 has a quick solution let me know !! Link to comment https://forums.phpfreaks.com/topic/35032-opening-hyper-link-with-get-variables-in-new-window/#findComment-165225 Share on other sites More sharing options...
mattd8752 Posted January 21, 2007 Share Posted January 21, 2007 Well, basically you want to run a javascript in the page, and where it would call to open the new window you would use php to echo <?php echo $somevar; ?> in the middle of your script IF somevar was what you wanted to put in that place. Link to comment https://forums.phpfreaks.com/topic/35032-opening-hyper-link-with-get-variables-in-new-window/#findComment-165226 Share on other sites More sharing options...
joebudden Posted January 21, 2007 Author Share Posted January 21, 2007 in the middle of my javascript? Link to comment https://forums.phpfreaks.com/topic/35032-opening-hyper-link-with-get-variables-in-new-window/#findComment-165234 Share on other sites More sharing options...
genericnumber1 Posted January 21, 2007 Share Posted January 21, 2007 Do you mean you want to control the size of the window that is opened? You could do something like this..[code]<script language="javascript">function openWindow(url, width, height) { window.open(url, "", "width="+width+",height="+height);}</script><a href="javascript:openWindow('information.php?id=<?php echo $r[$id];?>', 250, 250)">Open the window</a>[/code]Hope that helps... you can edit the size of the window by editting the 250, 250 with width, height... it's a pretty simple conceptyou can learn about other parameters for the window.open method [url=http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp]here[/url] and you can find how to add the menubar etc back in there, but if you need to ask questions you might want to post them in [url=http://www.phpfreaks.com/forums/index.php/board,6.0.html]javascript help[/url]. Link to comment https://forums.phpfreaks.com/topic/35032-opening-hyper-link-with-get-variables-in-new-window/#findComment-165241 Share on other sites More sharing options...
joebudden Posted January 21, 2007 Author Share Posted January 21, 2007 cheers mate, yer thats just what i wanted. Link to comment https://forums.phpfreaks.com/topic/35032-opening-hyper-link-with-get-variables-in-new-window/#findComment-165275 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.