php在同一窗口中与图像打开链接
我正在使用图像打开一个链接,但是我想确保链接始终在同一页面中打开,这是我的代码
echo "<a href=\"/mysite.com/$directory/$dir/$line\"><img src=\"/mysite.com/images/000001.png\" /></a>";
,但有时在新页面中打开,我尝试包括target =“ _ _ self”,但不能让此工作要工作
。链接是在电子邮件中发送的,因此在某些帐户中,一个流行窗口询问用户是否要打开或保存,这是我要避免的,并直接从电子邮件中打开链接。 Gmail,但不在Hotmail中
I am opening a link with an image, but I want to ensure that the link always opens in the same page, here is my code
echo "<a href=\"/mysite.com/$directory/$dir/$line\"><img src=\"/mysite.com/images/000001.png\" /></a>";
This works fine, but sometimes opens in a new page, i tried including target = "_self" but cannot get this to work
The link is sent in an email, so in some accounts, a pop window asks if the user wants to open or save, it is this I want to avoid and have the link open directly from the email which it does in gmail but not in hotmail
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这不是您可以控制的。电子邮件中的HTML由各种电子邮件客户端解释,他们决定如何打开链接。
Outlook Web应用程序(由Hotmail使用),将
target
属性自动绑在锚元素上,并包括target =“ _ blank”
而不是。Unfortunately, this is not something you can control. The HTML in the email is interpreted by the various email clients and they decide how links should be opened.
The Outlook Web App (used by Hotmail), automatically strips the
target
attribute on anchor elements and includestarget="_blank"
instead.