Jump to content

opening hyper link with get variables in new window


joebudden

Recommended Posts

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???
cheers matt

yer 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 dynamically

I'l keep searchin but if any1 has a quick solution let me know !!
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 concept

you 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].

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.