问题
I had make a php link but i want it to open in a specific size in a new window.Can anyone from here suggest anything?The link is an image.
echo "<td><center><a href=\"edituser.php?id=$row[id]\"><img src=image/edit.png></a></center></td>";
the link is connect with the database.It will open a form to edit user data.
回答1:
To open in a new window, you have to add target to your a tag, eg:
<a href="http://example.com" target="_blank">Example Link</a>
To configure the size it's opened at, afaik you'd have to use javascript,
<a href="http://example.com" onclick="window.open(this.href, '_blank', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">Example Link</a>
Here's a JS Fiddle
回答2:
Try this
echo "<td><center><a target='_blank' href=\"edituser.php?id=$row[id]\"><img src=image/edit.png></a></center></td>";
回答3:
This should open it in a new window:
<a target="_blank" href=\"edituser.php?id=$row[id]\"><img width="200" height="150" src=image/edit.png></a>
you can add "width" and "height" attributes to the "img" tag.
回答4:
I tried above code, but doesn't work. Instead of "_blank", I used "new"
echo '<a href="www.google.com" target="new" > <img src="small.jpg"></a></div>';
I'm not very sure about the quote. You may test out.
来源:https://stackoverflow.com/questions/18870366/how-to-make-php-image-link-open-in-a-new-window