控制器动作被调用了两次--- PHP的应用 [英] Controller actions being called twice --- Php application

查看:100
本文介绍了控制器动作被调用了两次--- PHP的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新左右,所以如果我失去了一些信息什么的,请让我知道,我会提供。我已经看了informationg有关这个错误,但我还没有发现相关的任何事情。 所以,这里的交易..我的一些控制器动作被调用两次,我刚刚注意到,当我想知道为什么我发送一些邮件的两倍(我已经得到了应用程序整合的电子邮件客户端)..也只有这样记录了什么我做之后,我注意到控制器被调用两次...顺便说一下,这只是发生时,我打电话从外部应用程序或通过输入URL的链接的动作。 如果我没有让自己清楚,不然我失去了一些东西,请不要张贴在这里反正让我可以添加更多的信息。

I'm new around so if I'm missing some info or something, please let me know and I'll provide it. I've already looked for informationg regarding this error, but I haven't found anything relevant yet. So, here's the deal.. Some of my controllers actions are being called twice, and I've just noticed that when I was wondering why was I sending SOME mails twice (the application I've got has an email client incorporated).. and only then after logging what was I doing I noticed the controller gets called twice... By the way, this only happens when I called the action from a link outside the application or by typing the url. If I'm not making myself clear or I'm missing something, please do post here anyway so I can add more info..

在此先感谢!

推荐答案

集结可能的答案从的其他 <一href="http://stackoverflow.com/questions/2153579/page-load-fires-twice-on-firefox-please-help">sources按我的意见:

Aggregating possible answers from other sources as per my comment:

  1. &LT; IMG SRC =/&GT; 和亲戚

如果你有,你产生的地方在 SRC IMG 标签的属性,确保它不是空的任何怪胎例;极少数的浏览器采取空SRC作为提示重新加载页面。 <一个href="http://stackoverflow.com/questions/2009092/page-loads-twice-in-google-chrome/2009422#2009422">1, <一href="http://stackoverflow.com/questions/2153579/page-load-fires-twice-on-firefox-please-help/2160741#2160741">2, <一href="http://stackoverflow.com/questions/2009092/page-loads-twice-in-google-chrome/2579980#2579980">3

If you have places where you generate the src attribute of the img tag, make sure it isn't empty in any freak cases; a handful of browsers take the empty src as a prompt to load the page again. 1, 2, 3

有一个空的图标也是一样,JavaScript或CSS 的href - 一般是什么,你要问的浏览器来获取外部资源,但没有URL提供,即使是在CSS <一href="http://stackoverflow.com/questions/2009092/page-loads-twice-in-google-chrome/2011977#2011977">1.

The same is true for an empty favicon, javascript or css href - generally anything where you're asking the browser to fetch an external resource, but no url is supplied, even in css1.

该phenomenom也许是一个更容易理解,如果你考虑,例如,当你发送表单数据,当你做的&LT;形式的行动=&GT; (甚至只是 &LT;形式GT; ) - 即在同一页

The phenomenom is perhaps a more understandable if you consider, for example, where you're sending form data when you do <form action=""> (or even just <form>) - namely the same page.

的.htaccess 的恶作剧。

检查重写规则(S):你是做服务器需要往返到你的脚本进行任何静态内容(如图标 <一个href="http://stackoverflow.com/questions/2009092/page-loads-twice-in-google-chrome/2849555#2849555">1)?难道不存在的文件触发打电话给你的脚本,并且是外部资源的链接指向一个(如被最终从文件系统中删除,但有人忘了从HTML源代码中删除一个古老的CSS样式表)?

Check your rewrite rule(s): Are you making the server take a roundtrip to your script for any static content (e.g. favicon1)? Do non-existent files trigger a call to your script, and is an external resource link pointing to one (e.g. an ancient css stylesheet that was finally deleted from the filesystem but someone forgot to remove it from the HTML source)?

基于浏览器的调试器。

某些基于浏览器的调试器,例如萤火 <一个href="http://stackoverflow.com/questions/2153579/page-load-fires-twice-on-firefox-please-help/2983201#2983201">1,将发送第二个请求,根据情况的页面,收集,这不是本机提供给他们的浏览器的数据。请确保你没有得到的。

Some browser-based debuggers, e.g. firebug1, will send a second request to the page depending on circumstances, to gather data that wasn't natively supplied to them by the browser itself. Make sure you're not getting that.

看看是否有那些帮助你。

See if any of those help you.

这篇关于控制器动作被调用了两次--- PHP的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆