如何使PHP图像链接在新窗口中打开


how to make php image link open in a new window

我做了一个php链接,但我希望它在新窗口中以特定大小打开。这里的任何人都可以提出任何建议吗?链接是图像。

echo "<td><center><a href='"edituser.php?id=$row[id]'"><img src=image/edit.png></a></center></td>";

链接与数据库连接。它将打开一个表单来编辑用户数据。

要在新窗口中打开,您必须将目标添加到您的标签中,例如:

<a href="http://example.com" target="_blank">Example Link</a>

要配置它打开的大小,你必须使用 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>

这是一个JS小提琴

试试这个

echo "<td><center><a target='_blank' href='"edituser.php?id=$row[id]'"><img src=image/edit.png></a></center></td>";

这应该在新窗口中打开它:

<a target="_blank" href='"edituser.php?id=$row[id]'"><img  width="200" height="150" src=image/edit.png></a>

您可以将"宽度"和"高度"属性添加到"IMG"标签。

我尝试了上面的代码,但不起作用。我用"新"代替"_blank"

echo '<a href="www.google.com" target="new" > <img src="small.jpg"></a></div>';

我不太确定报价。您可以测试一下。